From cd6ff625d48a63e024b05ed1a253be3551e41599 Mon Sep 17 00:00:00 2001 From: emusic Date: Thu, 22 Nov 2018 12:45:40 +0100 Subject: adding footer functionality --- .../wag/egov/egiz/pdfbox2/pdf/PDFUtilities.java | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'pdf-as-pdfbox-2/src/main/java') diff --git a/pdf-as-pdfbox-2/src/main/java/at/knowcenter/wag/egov/egiz/pdfbox2/pdf/PDFUtilities.java b/pdf-as-pdfbox-2/src/main/java/at/knowcenter/wag/egov/egiz/pdfbox2/pdf/PDFUtilities.java index 08ef64b7..995b4e10 100644 --- a/pdf-as-pdfbox-2/src/main/java/at/knowcenter/wag/egov/egiz/pdfbox2/pdf/PDFUtilities.java +++ b/pdf-as-pdfbox-2/src/main/java/at/knowcenter/wag/egov/egiz/pdfbox2/pdf/PDFUtilities.java @@ -89,17 +89,22 @@ public abstract class PDFUtilities implements IConfigurationConstants{ int yCoord = bim.getHeight() - 1 - (int)footer_line; - for(int row = yCoord; row >= 0; row--){ - for(int col = 0; col < bim.getWidth(); col++){ - int val = bim.getRGB(col, row); - if(val != bgColor.getRGB()){ - yCoord = row; - row=-1; - break; + for(int row = yCoord; row >= 0; row--) + { + if (row == 0) + yCoord = row; + else + { + for(int col = 0; col < bim.getWidth(); col++){ + int val = bim.getRGB(col, row); + if(val != bgColor.getRGB()){ + yCoord = row; + row=-1; + break; + } } } } - String outFile = settings.getValue(SIG_PLACEMENT_DEBUG_OUTPUT); if(outFile!=null){ ImageIOUtil.writeImage(bim, outFile, 72); -- cgit v1.2.3