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 2014/06/23 18:57:25 UTC

[jira] [Closed] (PDFBOX-1872) PDMetadata.exportXMPMetadata fails when Metadata has encrypted stream

     [ https://issues.apache.org/jira/browse/PDFBOX-1872?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler closed PDFBOX-1872.
--------------------------------------

    Resolution: Invalid
      Assignee: Andreas Lehmkühler

The "trick" is to check wether a pdf is encrypted and decrypt it before accessing the data. It's used in many tools and examples provided by PDFBox, e.g. [ExtractMetadata|http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ExtractMetadata.java?view=markup]

> PDMetadata.exportXMPMetadata fails when Metadata has encrypted stream
> ---------------------------------------------------------------------
>
>                 Key: PDFBOX-1872
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1872
>             Project: PDFBox
>          Issue Type: Bug
>          Components: JempBox, PDModel
>    Affects Versions: 1.8.3
>         Environment: Not sure it matters, but Solaris (SunOS 5.10), java 1.6.0_19,
>            Reporter: Pat Hickey
>            Assignee: Andreas Lehmkühler
>            Priority: Minor
>
> When the Metadata is encoded with the Crypt filter, exportMetadata() fails to parse the XML. My guess is that PDDocumentCatalog.getMetadata() gives PDMetadata the raw stream, instead of the filtered one. Then PDMetadata.exportXMPMetadata() calls XMPMetadata.load(), which cannot parse the encrypted stream.  
> While I cannot post the document (proprietary), the outline shown by PDFDebugger goes like this:
> Root:Dictionary(Catalog)
> + AcroForm:Dictionary
> - Metadata:Stream(Metadata:XML)
>  - Filter:Array
>      o [0] Crypt
>   o Length:6302
>   o Subtype:XML
>   o Type:Metadata



--
This message was sent by Atlassian JIRA
(v6.2#6252)