|
20 | 20 | import org.openlowcode.tools.pdf.PDFDocument; |
21 | 21 | import org.openlowcode.tools.pdf.PDFMultiPageTable; |
22 | 22 | import org.openlowcode.tools.pdf.PDFPage; |
| 23 | +import org.openlowcode.tools.pdf.PDFPage.BoxTextContent; |
23 | 24 | import org.openlowcode.tools.pdf.PDFPageBand; |
24 | 25 | import org.openlowcode.tools.pdf.PDFPageBandHeaders; |
25 | 26 | import org.openlowcode.tools.pdf.ParagraphHeader; |
@@ -69,7 +70,14 @@ private static void feedcontent(PDFDocument document) throws IOException { |
69 | 70 | coverpage.drawCenteredTextAt(true, coverpage.getPagetop() + 100, 0, "Open Lowcode PDF"); |
70 | 71 | coverpage.drawCenteredTextAt(false, coverpage.getPagetop() + 130, 0, "automatically generated document"); |
71 | 72 | document.addPDFPart(coverpage); |
72 | | - |
| 73 | + // demonstrate facilities to write text in box |
| 74 | + BoxTextContent boxsize = coverpage.drawTextInBox(coverpage.getPageLeft(),coverpage.getPagetop()+160, coverpage.getPageLeft()+60,"A real example showing main features of the library (excluding images)"); |
| 75 | + float bottomofbox1 = coverpage.drawBoxWithLineNumber(false,coverpage.getPageLeft(),coverpage.getPagetop()+160, coverpage.getPageLeft()+60, boxsize.getNblines(),boxsize.getNbparagraph()); |
| 76 | + // second box is put just 5 mm after first box |
| 77 | + BoxTextContent boxsize2 = coverpage.drawTextInBox(coverpage.getPageLeft(),bottomofbox1+5, coverpage.getPageLeft()+60,"All you see is quick to code."); |
| 78 | + coverpage.drawBoxWithLineNumber(false,coverpage.getPageLeft(),bottomofbox1+5, coverpage.getPageLeft()+60, boxsize2.getNblines(),boxsize2.getNbparagraph()); |
| 79 | + |
| 80 | + |
73 | 81 | // create document body |
74 | 82 | PDFPageBand documentbody = new PDFPageBand(header, true, 15, 10); |
75 | 83 | document.addPDFPart(documentbody); |
|
0 commit comments