pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tilman Hausherr (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PDFBOX-4541) Incorrect? handling of direct/indirect objects
Date Fri, 10 May 2019 10:04:00 GMT

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

Tilman Hausherr commented on PDFBOX-4541:
-----------------------------------------

I don't have the time to investigate this now, but it seems to be related to the problems
I hit in PDFBOX-45 when I wasn't careful enough. Search for the word "twice".

> Incorrect? handling of direct/indirect objects
> ----------------------------------------------
>
>                 Key: PDFBOX-4541
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4541
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Parsing, Writing
>    Affects Versions: 2.0.14
>            Reporter: Jonathan
>            Priority: Major
>              Labels: ready-to-commit
>
> We ran into some issues concerning blank pages in some of our resulting PDF documents.
Investigation showed that some objects which were referenced were never actually written.
We then noticed that these objects were never written because they missed the `isDirect` flag.
We were able to mitigate this issue by adding
> {code:java}
> if (retval != null) {
>     retval.setDirect(true);
> }
> return retval;
> {code}
> at the end of `BaseParser.parseDirObject()`.
> While the pdfs were now displayed correctly, QPDFs check reported erroneous hint tables.
The offsets there were calculated incorrectly because the objects were now written not only
once, but, in fact, several times in places where they should have been merely referenced.
We eventually resolved this issue by replacing the if-condiction
> {code:java}
> if (willEncrypt || incrementalUpdate || subValue instanceof COSDictionary || subValue
== null)
> {code}
> in `COSWriter.visitFromArray(COSArray)` and `COSWriter.visitFromDictionay(COSDictionary)`
with
> {code:java}
> if (willEncrypt || incrementalUpdate || subValue == null || !(subValue instanceof COSObject))
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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


Mime
View raw message