Hello. I get an exception while parsing XMPMetadata (details below) created by 
CreatePDFA (https://pdfbox.apache.org/1.8/cookbook/pdfacreation.html)


I have noticed that adding "xml:" before "lang" in the following line of the 
"<dc:title>" solves the issue:

          <rdf:li lang="x-default">out.pdf</rdf:li>

(Fixed line:    <rdf:li xml:lang="x-default">out.pdf</rdf:li> )

Is this an error in the metadata?


Additional details:

This is the complete XMP created by CreatePDFA (line 6 is the problem):

<x:xmpmeta xmlns:x="adobe:ns:meta/">
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";>
    <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/"; rdf:about="">
      <dc:title>
        <rdf:Alt>
          <rdf:li lang="x-default">out.pdf</rdf:li>
        </rdf:Alt>
      </dc:title>
    </rdf:Description>
    <rdf:Description xmlns:pdfaid="http://www.aiim.org/pdfa/ns/id/"; 
rdf:about="">
      <pdfaid:part>1</pdfaid:part>
      <pdfaid:conformance>B</pdfaid:conformance>
    </rdf:Description>
  </rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>


I tried to parse the XMP metadata with Adobe's XMP parser 
(http://www.adobe.com/devnet/xmp.html) and I get the following exception:

com.adobe.internal.xmp.XMPException: Nested content not allowed with 
rdf:resource or property attributes.

The code for parsing is basically:
XMPMetaFactory.parse(new FileInputStream(args[0]));
(I save the XMP metadata to a file with PDFDebugger)

I'm using pdfbox 2.0.5. I can provide more details (and step by step 
instructions to reproduce)  if needed.

Esteban Ruiz

Reply via email to