Details
Description
The goal is to add Metadata to an image within the PDF document.
It works with Java 11 till PDFBox 2.0.11.
It doesn't work with Java 11 from PDFBox 2.0.12 till PDFBox 2.0.21.
In the method retrieveMetadataOfImage(PDImageXObject imageForContentStream) the XMPMetadata is exported again. When use the DomXmpParser and parsing the InputStream an error occurs.
The error is about the missing "<" right at the beginning.
// Output Sep. 25, 2020 11:56:20 VORM. sample.application.SampleApplication retrieveMetadataOfImage SCHWERWIEGEND: null org.apache.xmpbox.xml.XmpParsingException: Failed to parse at org.apache.xmpbox.xml.DomXmpParser.parse(DomXmpParser.java:125) at sample.application.SampleApplication.retrieveMetadataOfImage(SampleApplication.java:112) at sample.application.SampleApplication.main(SampleApplication.java:74) Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content ist nicht zulässig in Prolog. at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:261) at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339) at java.xml/javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:122) at org.apache.xmpbox.xml.DomXmpParser.parse(DomXmpParser.java:121) ... 2 more
Attachments
Attachments
Issue Links
- blocks
-
PDFBOX-4967 PDImageXObject and XmpParsingException with a create date
- Closed