Robert Fink created PDFBOX-4966:
-----------------------------------
Summary: PDImageXObject and XmpParsingException
Key: PDFBOX-4966
URL: https://issues.apache.org/jira/browse/PDFBOX-4966
Project: PDFBox
Issue Type: Bug
Components: Parsing, PDModel, XmpBox
Affects Versions: 2.0.21, 2.0.20, 2.0.19, 2.0.18, 2.0.17, 2.0.16, 2.0.15,
2.0.14, 2.0.13, 2.0.12
Reporter: Robert Fink
Attachments: SampleApplication.java
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.
{code:java}
// 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
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]