ZUGFeRD/ZUV

ZUGFeRD easy sample does not validate

jstaerk opened this issue · 3 comments

Reported by Daniel Vinz, zugferd_2p0_EN16931_Einfach.pdf throws

<messages><error type="11">XMP Metadata: ConformanceLevel not found</error>
<error type="13">XMP Metadata: DocumentType not found</error>
<error type="21">XMP Metadata: DocumentFileName not found</error>
<error type="15">XMP Metadata: Version not found</error>
</messages>

the XPath (PDFValidator.java:188) is correct //*[local-name()=\"ConformanceLevel\"], potentially Mustang (:156 zi.getXMP();) delivers incorrect XMP, Mustang uses in ZUGFeRDImporter.java:131 a
InputStream XMP = doc.getDocumentCatalog().getMetadata().exportXMPMetadata();

The spec shows (maybe as example?) on pg 27 <rdf:Description rdf:about="" xmlns:zf="urn:zugferd:pdfa:CrossIndustryDocument:invoice:2p0#"> <zf:DocumentType>INVOICE</zf:DocumentType> <zf:DocumentFileName>zugferd-invoice.xml</zf:DocumentFileName> <zf:Version>2p0</zf:Version> <zf:ConformanceLevel>EN 16931</zf:ConformanceLevel> </rdf:Description> the
rdf of the file reads

<rdf:Description xmlns:fx="urn:zugferd:pdfa:CrossIndustryDocument:invoice:2p0#"
                       fx:ConformanceLevel="EN 16931"
                       fx:DocumentFileName="zugferd-invoice.xml"
                       fx:DocumentType="INVOICE"
                       fx:Version="1.0"
                       rdf:about=""/>
   </rdf:RDF>

i.e. the PDF/A extension schema is available as attributes, not elements, in the sample invoice. The PDF validators do not complain and https://www.pdflib.com/pdf-knowledge-base/xmp/free-xmp-validator/ says it's valid.

+added sample file to automatic tests, snap shot available on http://www.mustangproject.org/files/ZUV-0.7.0c-SNAPSHOT.jar