|
10 | 10 |
|
11 | 11 | package org.openlowcode.tools.pdf; |
12 | 12 |
|
| 13 | +import java.awt.Color; |
13 | 14 | import java.io.IOException; |
14 | 15 | import java.util.ArrayList; |
15 | 16 |
|
@@ -40,7 +41,9 @@ public void print(PDFPageBand pageband, PDFPage currentpage, float mmfromtopfors |
40 | 41 | float rightinmm) throws IOException { |
41 | 42 | for (int i = 0; i < content.size(); i++) { |
42 | 43 | PagedLabel label = content.get(i); |
43 | | - currentpage.drawSimpleTextAt(false, leftinmm, mmfromtopforsection, i, 0, label.getLabel()); |
| 44 | + float textsize = PDFPage.getTextSize(new String[] {label.getLabel()}, PDFPage.TEXTTYPE_PLAIN); |
| 45 | + currentpage.drawLine(false, leftinmm+10+textsize+ label.getOriginalOffset() / 3,mmfromtopforsection+i*PDFPage.LINE_SPACING_NORMAL_TEXT+PDFPage.PARAGRAPH_MARGIN_VERTICAL,rightinmm-25,mmfromtopforsection+i*PDFPage.LINE_SPACING_NORMAL_TEXT+PDFPage.PARAGRAPH_MARGIN_VERTICAL,Color.GRAY); |
| 46 | + currentpage.drawSimpleTextAt(false, leftinmm+ label.getOriginalOffset() / 3, mmfromtopforsection, i, 0, label.getLabel()); |
44 | 47 | currentpage.drawCalculatedText(rightinmm, mmfromtopforsection, i, 0, false, |
45 | 48 | () -> "" + label.getPageNumber()); |
46 | 49 | } |
@@ -69,10 +72,12 @@ public PartialPrintFeedback printPartial(PDFPageBand pageband, float spaceleft, |
69 | 72 | } |
70 | 73 | for (int i = 0; i < linestoprint; i++) { |
71 | 74 | PagedLabel label = content.get(i + currentindex); |
72 | | - currentpage.drawSimpleTextAt(false, leftinmm + 15 + label.getOriginalOffset() / 3, mmfromtopforsection, i, |
| 75 | + float textsize = PDFPage.getTextSize(new String[] {label.getLabel()}, PDFPage.TEXTTYPE_PLAIN); |
| 76 | + currentpage.drawSimpleTextAt(false, leftinmm+ label.getOriginalOffset() / 3, mmfromtopforsection, i, |
73 | 77 | 0, label.getLabel()); |
74 | | - currentpage.drawCalculatedText(leftinmm + 15, mmfromtopforsection, i, 0, false, |
| 78 | + currentpage.drawCalculatedText(rightinmm-20, mmfromtopforsection, i, 0, false, |
75 | 79 | () -> "" + label.getPageNumber()); |
| 80 | + currentpage.drawLine(false, leftinmm+5+PDFPage.PARAGRAPH_MARGIN_HORIZONTAL/PDFPage.MM_TO_POINT+textsize+ label.getOriginalOffset() / 3,mmfromtopforsection+PDFPage.getTextVerticalOffsetInMM(i,0),rightinmm-25,mmfromtopforsection+PDFPage.getTextVerticalOffsetInMM(i,0),Color.GRAY); |
76 | 81 | } |
77 | 82 | currentindex = currentindex + linestoprint; |
78 | 83 | return new PartialPrintFeedback( |
|
0 commit comments