From e45125d5f3bab6eb2dbbb581ad7bac9c317ca10f Mon Sep 17 00:00:00 2001 From: rpiazzi Date: Tue, 30 Aug 2011 12:43:44 +0000 Subject: Correction to not create a new page, as it is done when signature block hasn't enough place, when signature block is invisible git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@797 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../egov/egiz/framework/signators/BinarySignator_1_0_0.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/framework/signators/BinarySignator_1_0_0.java b/src/main/java/at/knowcenter/wag/egov/egiz/framework/signators/BinarySignator_1_0_0.java index 49e2858..46245d2 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/framework/signators/BinarySignator_1_0_0.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/framework/signators/BinarySignator_1_0_0.java @@ -131,6 +131,18 @@ public class BinarySignator_1_0_0 implements Signator variable_field_definitions.add(sfd); } } + + //check if signature block is invisible, and if so and if also signature block is positioned + //on a new page, prevent pdf-as to do that, because why should make a new page just for an invisible block + //added by rpiazzi + if (signature_object.getSignatureTypeDefinition().getInvisibleFieldDefinitions().size()==SignatureTypes.REQUIRED_SIG_KEYS.length) { + if (pi.isMakeNewPage()) { + int pageNumber = pi.getPage(); + pi = new PositioningInstruction(false, pageNumber-1, 0, 0); + } + } + //end added + IncrementalUpdateInformation iui = IncrementalUpdateHelper.writeIncrementalUpdate(pdf, pdf_table, signature_type, pi, variable_field_definitions, all_field_definitions, null, null, null); String temp_string = iui.temp_ir_number + " " + iui.temp_ir_generation + " obj"; //$NON-NLS-1$//$NON-NLS-2$ -- cgit v1.2.3