[
https://issues.apache.org/jira/browse/PDFBOX-5977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tilman Hausherr resolved PDFBOX-5977.
-------------------------------------
Fix Version/s: 1.8.18
Assignee: Tilman Hausherr
Resolution: Fixed
> PDFA schema not detected because namespaces expected on attribute level
> -----------------------------------------------------------------------
>
> Key: PDFBOX-5977
> URL: https://issues.apache.org/jira/browse/PDFBOX-5977
> Project: PDFBox
> Issue Type: Bug
> Components: JempBox
> Affects Versions: 1.8.17
> Reporter: Tilman Hausherr
> Assignee: Tilman Hausherr
> Priority: Major
> Fix For: 1.8.18
>
>
> {code:java}
> String s = "<?xml version=\"1.0\" encoding=\"UTF-8\"
> standalone=\"no\"?>\n" +
> "<?xpacket begin=\"\" id=\"W5M0MpCehiHzreSzNTczkc9d\"?><rdf:RDF
> xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"
> xmlns:pdf=\"http://ns.adobe.com/pdf/1.3/\"
> xmlns:pdfaid=\"http://www.aiim.org/pdfa/ns/id/\">\n" +
> " <rdf:Description pdfaid:conformance=\"B\" pdfaid:part=\"3\"
> rdf:about=\"\"/>\n" +
> " <rdf:Description pdf:Producer=\"WeasyPrint 64.1\" rdf:about=\"\"/>\n" +
> "</rdf:RDF><?xpacket end=\"r\"?>";
> XMPMetadata xmp = XMPMetadata.load(new
> ByteArrayInputStream(s.getBytes()));
> xmp.addXMLNSMapping(XMPSchemaPDFAId.NAMESPACE, XMPSchemaPDFAId.class);
> XMPSchemaPDFAId schema = (XMPSchemaPDFAId)
> xmp.getSchemaByClass(XMPSchemaPDFAId.class);
> System.out.println(schema.getConformance() + " " + schema.getPart());
> {code}
> This fails with an NPE because
> {{xmp.getSchemaByClass(XMPSchemaPDFAId.class)}} is null.
> While most PDFBox users use xmpbox, some may still use jempbox due to bugs,
> especially our sister project Apache Tika.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]