@@ -48,7 +48,7 @@ public class PDFReportPDFBox extends GXReportPDFCommons{
48
48
private String barcodeType = null ;
49
49
private PDDocument document ;
50
50
private PDDocumentCatalog writer ;
51
- private PDType0Font templateFont ;
51
+ private PDFont templateFont ;
52
52
private float templateX ;
53
53
private float templateY ;
54
54
public boolean lineCapProjectingSquare = true ;
@@ -854,14 +854,14 @@ else if (barcodeType != null) {
854
854
// Handle {{Pages}}
855
855
if (sTxt .trim ().equalsIgnoreCase ("{{Pages}}" )) {
856
856
if (!templateCreated ) {
857
- templateFont = new PDType0Font ( baseFont . getCOSObject ()) ;
857
+ templateFont = baseFont ;
858
858
templateFontSize = fontSize ;
859
859
templateColorFill = foreColor ;
860
860
templateX = leftAux + leftMargin ;
861
861
templateY = this .pageSize .getUpperRightY () - bottomAux - topMargin - bottomMargin ;
862
862
templateCreated = true ;
863
863
}
864
- return ;
864
+ sTxt = String . valueOf ( this . page ) ;
865
865
}
866
866
867
867
float textBlockWidth = rightAux - leftAux ;
@@ -1271,20 +1271,6 @@ public void GxEndDocument() {
1271
1271
document .addPage (new PDPage (this .pageSize ));
1272
1272
pages ++;
1273
1273
}
1274
- if (templateCreated ) {
1275
- for (PDPage page : document .getPages ()){
1276
- try (PDPageContentStream templatePainter = new PDPageContentStream (document , page , PDPageContentStream .AppendMode .APPEND ,true , true )) {
1277
- templatePainter .beginText ();
1278
- templatePainter .setFont (templateFont , templateFontSize );
1279
- templatePainter .setNonStrokingColor (templateColorFill );
1280
- templatePainter .newLineAtOffset (templateX , templateY );
1281
- templatePainter .showText (String .valueOf (pages ));
1282
- templatePainter .endText ();
1283
- } catch (IOException e ){
1284
- log .error ("GxEndDocument: failed to apply template" , e );;
1285
- }
1286
- }
1287
- }
1288
1274
int copies = 1 ;
1289
1275
try {
1290
1276
copies = Integer .parseInt (printerSettings .getProperty (form , Const .COPIES ));
0 commit comments