diff options
author | emusic <emina.music@egiz.gv.at> | 2018-05-14 16:38:43 +0200 |
---|---|---|
committer | emusic <emina.music@egiz.gv.at> | 2018-05-14 16:38:43 +0200 |
commit | 797634c687c6f44d314e4baa3fed220d142eed73 (patch) | |
tree | 56dc1ce81e81ff100261aa779a68dcbc61ecc0e5 /pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib | |
parent | 0a59371516348ba36163128060e02e997099fcbd (diff) | |
download | pdf-as-4-797634c687c6f44d314e4baa3fed220d142eed73.tar.gz pdf-as-4-797634c687c6f44d314e4baa3fed220d142eed73.tar.bz2 pdf-as-4-797634c687c6f44d314e4baa3fed220d142eed73.zip |
changes in pdf-as-lib4.1.3
Diffstat (limited to 'pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib')
-rw-r--r-- | pdf-as-pdfbox-2/src/main/java/at/gv/egiz/pdfas/lib/impl/pdfbox2/positioning/Positioning.java | 8 |
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! |