Tilman Hausherr created PDFBOX-5977:
---------------------------------------
Summary: PDFA schema not detected
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
{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.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]