You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (Jira)" <ji...@apache.org> on 2021/05/31 06:32:00 UTC

[jira] [Comment Edited] (PDFBOX-5170) Compression creates issue with Page structure

    [ https://issues.apache.org/jira/browse/PDFBOX-5170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17354239#comment-17354239 ] 

Andreas Lehmkühler edited comment on PDFBOX-5170 at 5/31/21, 6:31 AM:
----------------------------------------------------------------------

PDFBox doesn't support writing hybrid cross reference information and the current implementation stumbles upon such a hybrid pdf. I've fixed COSWriter so that it writes either cross reference tables (pdfs without compression) or cross reference streams (pdfs with compression or hybrid pdfs which are "converted" to use cross reference streams only).

The resulting cross reference table isn't optimal as it has a lot of unused object numbers in the beginning. I'm going to have a look


was (Author: lehmi):
PDFBox doesn't support writing hybrid cross reference information and the current implementation stumbles upon such a hybrid pdf. I've fixed COSWriter so that it writes either cross reference tables (pdfs without compression) or cross reference streams (pdfs with compression or hybrid pdfs which are "converted" to use cross reference streams only)

> Compression creates issue with Page structure
> ---------------------------------------------
>
>                 Key: PDFBOX-5170
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5170
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Writing
>    Affects Versions: 3.0.0 PDFBox
>            Reporter: Daniel Persson
>            Assignee: Andreas Lehmkühler
>            Priority: Minor
>             Fix For: 3.0.0 PDFBox
>
>
>  
> Hi Team.
>  
> PDFBox version 3.0.0-RC1
> pdftoppm version 21.04.0
> mupdf-gl version 1.18.0
>  
> This might be an unusual issue but might needs to be checked. The simple code below creates a PDF that can't be viewed with Poppler because of "error: malformed page tree"​
> {code:java}
> PDDocument testPdf = Loader.loadPDF(new File("input.pdf"));
> testPdf.save(new File("output.pdf"));
> testPdf.close();
> PDDocument testPdf2 = Loader.loadPDF(new File("input.pdf"));
> testPdf2.save(new File("output2.pdf"), CompressParameters.NO_COMPRESSION);
> testPdf2.close();
> {code}
> This is not a content issue because all PDFs from the same producer have the same problem, I've just picked an example.
> Best regards
> Daniel
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org