[
https://issues.apache.org/jira/browse/PDFBOX-2708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14360651#comment-14360651
]
Radomir Mladenovic commented on PDFBOX-2708:
--------------------------------------------
I tracked this down to PDPageTree.remove() that was invoking COSArray.remove()
which didn't work if page was indirectly referenced. Can be fixed using
COSArray.removeObject() instead.
Pages were removed from the end of the document as the rest of
PDPageTree.remove() was updating COSName.COUNT although removal from the
dictionary actually failed.
I'll send a pull request with a fix.
> PDDocument.removePage() deletes the last page regardless of parameter passed
> ----------------------------------------------------------------------------
>
> Key: PDFBOX-2708
> URL: https://issues.apache.org/jira/browse/PDFBOX-2708
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Affects Versions: 2.0.0
> Reporter: Radomir Mladenovic
> Priority: Blocker
> Labels: regression
> Fix For: 2.0.0
>
>
> This can be easily reproduced using provided example
> org.apache.pdfbox.examples.pdmodel.RemoveFirstPage that will delete the last
> page from document instead the first one.
> I think this bug was introduced within the last 3 months as my older snapshot
> build worked fine.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]