[
https://issues.apache.org/jira/browse/PDFBOX-5561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17681075#comment-17681075
]
Tilman Hausherr commented on PDFBOX-5561:
-----------------------------------------
It happens without the code (I'm so lazy that I didn't try it 😂), just load and
save 😬
> qpdf shows warnings trying to linearize file modified by PDFBOX
> ---------------------------------------------------------------
>
> Key: PDFBOX-5561
> URL: https://issues.apache.org/jira/browse/PDFBOX-5561
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 2.0.27
> Reporter: menteith85
> Priority: Minor
>
> I have a PDF file* that is generated by a software other than PDFBox. When
> the PDF is modified by code given below using PDFBOX, *qpdf*Â shows the
> following warning:
> {code:java}
> WARNING: modified.pdf: reported number of objects (12991) is not one plus the
> highest object number (12989) }}
> qpdf: operation succeeded with warnings; resulting file may have some
> problems{code}
> Note the warning is not shown when *qpdf* analyses original pdf file (ie. pdf
> not modified by PDFBox).
> Here's the code to modify PDF in question:
> Â
> {code:java}
> for (final PDPage page: document.getPages()) {
> Â Â page.getAnnotations().forEach(annotation - > {
> Â Â Â Â if (annotation instanceof PDAnnotationLink link) {
> Â Â Â Â Â Â final PDPageXYZDestination destination = new
> PDPageXYZDestination();
> Â Â Â Â Â Â destination.setPage(document.getPage(1));
> Â Â Â Â Â Â final PDActionGoTo action = new PDActionGoTo();
> Â Â Â Â Â Â action.setDestination(destination);
> Â Â Â Â Â Â link.setAction(action);
> Â Â Â Â }
> Â Â });
> } {code}
> Â
> *I've sent the file to Tilman Hausherr.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]