Skip to content

Commit bc6daf9

Browse files
tomas-sexenianBeta Bot
authored andcommitted
Cherry pick branch 'genexuslabs:pages-placeholder' into beta
1 parent b5cff35 commit bc6daf9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

java/src/main/java/com/genexus/reports/PDFReportPDFBox.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)