@@ -61,6 +61,7 @@ public class PDFReportPDFBox extends GXReportPDFCommons{
6161 private final float DEFAULT_PDFBOX_LEADING = 1.2f ;
6262 private Set <String > supportedHTMLTags = new HashSet <>();
6363 private PDPageContentStream currentPageContentStream ;
64+ private final String pagesPlaceHolder = "{{pages}}" ;
6465
6566 static {
6667 log = org .apache .logging .log4j .LogManager .getLogger (PDFReportPDFBox .class );
@@ -854,7 +855,7 @@ else if (barcodeType != null) {
854855 }
855856
856857 // Handle {{Pages}}
857- if (sTxt .trim ().equalsIgnoreCase ("{{Pages}}" )) {
858+ if (sTxt .trim ().equalsIgnoreCase (pagesPlaceHolder )) {
858859 if (!templateCreated ) {
859860 templateFont = baseFont ;
860861 templateFontSize = fontSize ;
@@ -863,7 +864,7 @@ else if (barcodeType != null) {
863864 templateY = this .pageSize .getUpperRightY () - bottomAux - topMargin - bottomMargin ;
864865 templateCreated = true ;
865866 }
866- sTxt = "{{pages}}" ;
867+ sTxt = pagesPlaceHolder ;
867868 }
868869
869870 float textBlockWidth = rightAux - leftAux ;
@@ -1274,8 +1275,8 @@ private void replaceTemplatePages() throws IOException {
12741275 final List <float []> replacements = new java .util .ArrayList <>();
12751276 PDFTextStripper stripper = new PDFTextStripper () {
12761277 @ Override
1277- protected void writeString (String text , List <org . apache . pdfbox . text . TextPosition > textPositions ) throws IOException {
1278- String placeholder = "{{pages}}" ;
1278+ protected void writeString (String text , List <TextPosition > textPositions ) throws IOException {
1279+ String placeholder = pagesPlaceHolder ;
12791280 int index = text .indexOf (placeholder );
12801281 while (index != -1 && index + placeholder .length () <= textPositions .size ()) {
12811282 float minX = Float .MAX_VALUE ;
0 commit comments