You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Esteban Nicolas Ruiz (JIRA)" <ji...@apache.org> on 2017/08/14 14:09:00 UTC

[jira] [Commented] (PDFBOX-3401) PDObjectReference getReferencedObject() returns null is referenced obj is not a COSStream

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

Esteban Nicolas Ruiz commented on PDFBOX-3401:
----------------------------------------------

Hello. I'm facing the same issue.

I have tryied changing a local copy of pdfbox sources, line 165 in ./pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDNumberTreeNode.java: 
{{COSObjectable pdValue = convertCOSToPD( cosValue );}}
for
{{COSObjectable pdValue = (COSObjectable)  cosValue ;}}

That solved the issue in my case (the node contained a reference, maybe it fails with an array of references?) 

> PDObjectReference getReferencedObject() returns null is referenced obj is not a COSStream
> -----------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-3401
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3401
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 1.8.9, 2.0.2, 2.0.3, 3.0.0
>            Reporter: Mark Melling
>         Attachments: 000671.pdf
>
>
> When creating a pdf I am setting a PDAnnotation as the referenced object of a PDObjectReference using setReferencedObject.
> When I subsequently load the same document and then call getReferencedObject on the PDObjectReference, null is returned. This is because an exception is thrown in PDXObject.createXObject (called inside getReferencedObject) as the referenced object is not a COSStream, just a COSDictionary.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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