aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox-2
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-pdfbox-2')
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/Positioning.java10
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java2
2 files changed, 6 insertions, 6 deletions
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 1a51b4db..a147c791 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
@@ -171,22 +171,22 @@ public class Positioning {
page = pos.getPage();
// System.out.println("XXXXPAGE="+page+" doc_pages="+doc_pages);
- if (page > doc_pages && page!=1) {
+ if (page > doc_pages) {
make_new_page = true;
page = doc_pages;
// throw new PDFDocumentException(227, "Page number is to big(="
// + page+
// ") cannot be parsed.");
}
-
- if (page < doc_pages && page!=1) {
+ /*if (page < doc_pages && page!=1) {
page = page - 1;
- }
+ }*/
}
+
+
PDPage pdPage = pdfDataSource.getPage(page-1);
- //PDPage pdPage = pdfDataSource.getPages().get(page);
PDRectangle cropBox = pdPage.getCropBox();
diff --git a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java
index 897218e5..3cb103a7 100644
--- a/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java
+++ b/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox2/PADESPDFBOXSigner.java
@@ -383,7 +383,7 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants {
IOUtils.closeQuietly(colorProfile);
}
}
- options.setPage(positioningInstruction.getPage());
+ options.setPage(positioningInstruction.getPage()-1);
options.setVisualSignature(properties.getVisibleSignature());
}