From 59b738ffa58aef22454270d49d081a4506fc43cf Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Wed, 31 Jul 2013 10:58:22 +0200 Subject: Legacy Positionierung 3.2 ist nun Profil anhaengig --- .../main/java/at/knowcenter/wag/egov/egiz/PdfAS.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java') diff --git a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java index 2681f80..a09a238 100644 --- a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java +++ b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/PdfAS.java @@ -1288,8 +1288,19 @@ public abstract class PdfAS // y:auto pos = new TablePos(); } + + // afitzek + // Allow legacy positioning (3.2) for BRZ Templates ... + boolean legacy32 = false; + String leg = SettingsReader.getInstance().getSetting(SignatureTypes.SIG_OBJ + signature_type + ".legacy.pos", "false"); + if (leg != null) { + if ("true".equals(leg.trim())) { + legacy32 = true; + } + } + // System.out.println("Tablepos="+pos); - return PdfAS.adjustSignatureTableandCalculatePosition(pdfDataSource, pdf_table, pos); + return PdfAS.adjustSignatureTableandCalculatePosition(pdfDataSource, pdf_table, pos, legacy32); } /** @@ -1304,7 +1315,7 @@ public abstract class PdfAS * @throws PDFDocumentException * F.e. */ - public static PositioningInstruction adjustSignatureTableandCalculatePosition(final PdfDataSource pdfDataSource, PdfPTable pdf_table, TablePos pos) throws PDFDocumentException + public static PositioningInstruction adjustSignatureTableandCalculatePosition(final PdfDataSource pdfDataSource, PdfPTable pdf_table, TablePos pos, boolean legacy32) throws PDFDocumentException { PdfReader reader = null; @@ -1389,7 +1400,7 @@ public abstract class PdfAS // up to here no checks have to be made if Tablesize and Pagesize are fit // Now we have to getfreespace in page and reguard footerline float footer_line = pos.getFooterLine(); - float pre_page_length = PDFUtilities.calculatePageLength(pdfDataSource, page - 1, page_height - footer_line, page_rotation); + float pre_page_length = PDFUtilities.calculatePageLength(pdfDataSource, page - 1, page_height - footer_line, page_rotation, legacy32); if (pre_page_length == Float.NEGATIVE_INFINITY) { // we do have an empty page or nothing in area above footerline -- cgit v1.2.3