Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.7.1
-
None
-
None
Description
I've seen a bug trying to split pages of a pdf document.
For example, I got a 5 pages pdf document and I try to create a document with pages 4 to 5.
I set startPage to 3 and endPage to 5 (also tried to set page number to 3) but it creates a document with pages 3 to 4 and a other one with page 5.
I analysed a little bit the problem and it looks like it comes from the value of pageNumber variable in Splitter.class.
This is how I solved it (rewriting 3 methods) :
@Override
protected void processPages(List pages) throws IOException {
Iterator iter = pages.iterator();
while( iter.hasNext() ) {
PDPage page = (PDPage)iter.next();
pageNumber++;
if (pageNumber >= getStartPage() && pageNumber <= getEndPage())
else {
if (pageNumber > getEndPage())
}
}
}
@Override
protected void processNextPage( PDPage page ) throws IOException
@Override
protected boolean isNewDocNecessary()
Attachments
Issue Links
- depends upon
-
PDFBOX-1517 PDFSplit: split is set to one if no -split argument present
- Closed