You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2025/04/10 14:16:00 UTC

[jira] [Reopened] (PDFBOX-5977) PDFA schema not detected

     [ https://issues.apache.org/jira/browse/PDFBOX-5977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tilman Hausherr reopened PDFBOX-5977:
-------------------------------------

> 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
>            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: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org