aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas
diff options
context:
space:
mode:
Diffstat (limited to 'pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas')
-rw-r--r--pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/Positioning.java8
1 files changed, 5 insertions, 3 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 680abe6d..1a51b4db 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
@@ -29,6 +29,7 @@ import java.io.IOException;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
+import org.apache.pdfbox.pdmodel.PDPageTree;
import org.apache.pdfbox.pdmodel.common.PDRectangle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -170,7 +171,7 @@ public class Positioning {
page = pos.getPage();
// System.out.println("XXXXPAGE="+page+" doc_pages="+doc_pages);
- if (page > doc_pages) {
+ if (page > doc_pages && page!=1) {
make_new_page = true;
page = doc_pages;
// throw new PDFDocumentException(227, "Page number is to big(="
@@ -178,14 +179,15 @@ public class Positioning {
// ") cannot be parsed.");
}
- if (page < doc_pages) {
+ 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();
// fallback to MediaBox if Cropbox not available!