You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2014/12/23 16:25:13 UTC

[jira] [Commented] (PDFBOX-2440) xref stream is saved as table

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

ASF subversion and git services commented on PDFBOX-2440:
---------------------------------------------------------

Commit 1647593 from [~lehmi] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1647593 ]

PDFBOX-2440: improved XRef type handling

> xref stream is saved as table
> -----------------------------
>
>                 Key: PDFBOX-2440
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2440
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Writing
>    Affects Versions: 1.8.7
>            Reporter: WB
>            Assignee: Andreas Lehmkühler
>             Fix For: 2.0.0
>
>         Attachments: COSWriter.diff, lipsum.pdf
>
>
> When saving a PDDocument, PdfBox seems to always write an xref table, even when the original file contains an xref stream.
> To reproduce, load a PDF file (like the one attached) with PDDocument#load (or PDDocument#loadNonSeq, same result) and then save it with PDDocument#save to another file.
> It seems to me that the problem is in COSWriter#doWriteXRef. When COSDocument#isXRefStream is true, the xref entries should be wrapped in a stream, but they're written to output one by one. I think that part should look more like its counterpart in COSWriter#doWriteXRefInc.
> I made some changes to doWriteXRef accordingly and it seems to work for PDFs that have never been incrementally updated but leads to corrupt files when the PDF has been incrementally updated before :(



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)