I want to create a valid PDF/A2-b File. After that in wanna put in a ZUGFeRD invoice with the PDFLib libary.
Every time I check the PDF with a Online Validator I get the following error:
rechnung.pdf does not conform to PDF/A.
Validating file "rechnung.pdf" for conformance level pdfa-2b
dc:language :: Wrong value type. Expected type 'bag'.
The document does not conform to the requested standard.
The document's meta data is either missing or inconsistent or corrupt.
Done.
Here´s the part with my meta informations for FOP.
<fo:declarations>
<x:xmpmeta xmlns:x="adobe:ns:meta/">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:title>
<rdf:Alt>
<rdf:li xml:lang="x-default">Titel</rdf:li>
</rdf:Alt>
</dc:title>
<dc:creator>
<rdf:Seq>
<rdf:li>Creator</rdf:li>
</rdf:Seq>
</dc:creator>
<dc:description>
<rdf:Alt>
<rdf:li xml:lang="x-default">PDF/A Rechnung</rdf:li>
</rdf:Alt>
</dc:description>
<dc:date>
<rdf:Seq>
<rdf:li>2016-10-20</rdf:li>
</rdf:Seq>
</dc:date>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:xmp="http://ns.adobe.com/xap/1.0/">
<!-- XMP properties go here -->
<xmp:CreatorTool>Creator Tool</xmp:CreatorTool>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
</fo:declarations>
FOP gets the language part for the meta data from the fo:root element.
<fo:root xml:lang="de"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
font-family="PT-Sans" font-weight="normal" font-style="normal"
xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
But when I´m opening the PDF File with my notepad++, the dc:language has no type specification. And that´s the problem I think.
How can I get these specification in the file?
Bevor that I have tried to add it like the other declarations like that:
<dc:language>
<rdf:Bag>
<rdf:li>de-DE</rdf:li>
</rdf:Bag>
</dc:language>
But then I get the same failure message from the Validator. Why? Because then the language in the PDF file has the following content:
<dc:language>x-unknown</dc:language>
The value "x-unknown" is comming directly from FOP I think.
In a forum I have read that there is a method in the constructor from the java/org/apache/fop/pdf/PDFRoot.java file that is called "setLanguage("x-unknown");" since FOP 1.1.
Than I have looked in the actually FOP und she is still inside.
java/org/apache/fop/pdf/PDFRoot.java[80:9]
public PDFRoot(PDFDocument document, PDFPages pages) {
this.document = document;
setObjectNumber(document);
put("Type", new PDFName("Catalog"));
setRootPages(pages);
setLanguage("x-unknown");
}