From 8525e93330ed046bec63daedbeba732416970121 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Tue, 18 Apr 2023 20:16:31 +0200 Subject: chore(pos): change order of configuration check for 'less space' check profile specific configuration first and 'failOnLessSpace' afterwards --- .../gv/egiz/pdfas/lib/impl/pdfbox2/positioning/Positioning.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pdf-as-pdfbox-2/src/main/java/at/gv/egiz') diff --git a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/Positioning.java b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/Positioning.java index f942d77e..31de6446 100644 --- a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/Positioning.java +++ b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/Positioning.java @@ -259,13 +259,13 @@ public class Positioning { SignatureProfileSettings profilConfig) throws PdfAsException { if(make_new_page && numberOfExistingSignatures!=0) { log.debug("Signature-block would be need a new page, but new pages are not allowed on already signed documents."); - if (isFailOnLessSpaceEnabled(settings)) { - throw new PdfAsException("error.pdf.stamp.12"); - - } else if (isNewPageOnSignedDocumentsEnabled(profilConfig)) { + if (isNewPageOnSignedDocumentsEnabled(profilConfig)) { log.info("New pages not allowed on already signed documents, but force new page by configuration"); return make_new_page; + } else if (isFailOnLessSpaceEnabled(settings)) { + throw new PdfAsException("error.pdf.stamp.12"); + } else { log.info("Placing signature-block on last page without free-space checks ... "); return false; -- cgit v1.2.3