aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox/src/main/java/at/gv/egiz
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2016-04-12 14:56:05 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2016-04-12 14:56:05 +0200
commit8998df18e776b4bf17a4c731e0b9c3aad926ca6d (patch)
tree1ae0bbf81c186096b9491ab23c6e2948829c8abf /pdf-as-pdfbox/src/main/java/at/gv/egiz
parent98076fc60c31be00584c81d4ce7c2ef29d2c7eb2 (diff)
downloadpdf-as-4-8998df18e776b4bf17a4c731e0b9c3aad926ca6d.tar.gz
pdf-as-4-8998df18e776b4bf17a4c731e0b9c3aad926ca6d.tar.bz2
pdf-as-4-8998df18e776b4bf17a4c731e0b9c3aad926ca6d.zip
Changed automatic positioning to handle annotation partly above the footerline, introduced legacy40.pos option to disable the change
Diffstat (limited to 'pdf-as-pdfbox/src/main/java/at/gv/egiz')
-rw-r--r--pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox/positioning/Positioning.java8
-rw-r--r--pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java8
2 files changed, 8 insertions, 8 deletions
diff --git a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox/positioning/Positioning.java b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox/positioning/Positioning.java
index 7aa3fa71..e2f245a7 100644
--- a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox/positioning/Positioning.java
+++ b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox/positioning/Positioning.java
@@ -77,9 +77,9 @@ public class Positioning {
*/
public static PositioningInstruction determineTablePositioning(
TablePos pos, String signature_type, PDDocument pdfDataSource,
- IPDFVisualObject pdf_table, boolean legacy32) throws PdfAsException {
+ IPDFVisualObject pdf_table, boolean legacy32, boolean legacy40) throws PdfAsException {
return adjustSignatureTableandCalculatePosition(pdfDataSource,
- pdf_table, pos, legacy32);
+ pdf_table, pos, legacy32, legacy40);
}
private static PDRectangle rotateBox(PDRectangle cropBox, int rotation) {
@@ -153,7 +153,7 @@ public class Positioning {
*/
public static PositioningInstruction adjustSignatureTableandCalculatePosition(
final PDDocument pdfDataSource, IPDFVisualObject pdf_table,
- TablePos pos, boolean legacy32) throws PdfAsException {
+ TablePos pos, boolean legacy32, boolean legacy40) throws PdfAsException {
PdfBoxUtils.checkPDFPermissions(pdfDataSource);
// get pages of currentdocument
@@ -265,7 +265,7 @@ public class Positioning {
float pre_page_length = PDFUtilities.calculatePageLength(pdfDataSource,
page - 1, page_height - footer_line, /* page_rotation, */
- legacy32);
+ legacy32, legacy40);
if (pre_page_length == Float.NEGATIVE_INFINITY) {
// we do have an empty page or nothing in area above footerline
diff --git a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java
index 97faf102..6d035b30 100644
--- a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java
+++ b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java
@@ -35,7 +35,6 @@ import java.io.InputStream;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
-import java.util.UUID;
import org.apache.commons.io.IOUtils;
import org.apache.pdfbox.cos.COSArray;
@@ -261,6 +260,7 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
}
boolean legacy32Position = signatureProfileConfiguration.getLegacy32Positioning();
+ boolean legacy40Position = signatureProfileConfiguration.getLegacy40Positioning();
// create Table describtion
Table main = TableFactory.createSigTable(signatureProfileSettings, MAIN, pdfObject.getStatus(),
@@ -277,7 +277,7 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
*/
PositioningInstruction positioningInstruction = Positioning.determineTablePositioning(tablePos, "",
- doc, visualObject, legacy32Position);
+ doc, visualObject, legacy32Position, legacy40Position);
logger.debug("Positioning: {}", positioningInstruction.toString());
@@ -722,10 +722,10 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
PositioningInstruction positioningInstruction = null;
if (signaturePosString != null) {
positioningInstruction = Positioning.determineTablePositioning(new TablePos(signaturePosString), "",
- origDoc, visualObject, false);
+ origDoc, visualObject, false, false);
} else {
positioningInstruction = Positioning.determineTablePositioning(new TablePos(), "", origDoc,
- visualObject, false);
+ visualObject, false, false);
}
origDoc.close();