itext-java
itext-java copied to clipboard
Correct XMP URI serialisation in PDF/UA ext schema
URIs and text follow different conventions in the XMP data model. While many parsers tolerate URIs encoded as text, it's technically not allowed. Without this fix, iText will output PDF/A+UA files in which the pdfuaid extension declaration (more specifically, the pdfaSchema:namespaceURI property) violates ISO 16684-1:2011, 7.9.2.2:
Property and structure field elements that have normal (non-URI) simple, unqualified values may be replaced with attributes in the rdf:Description element. This also applies to the pseudo-structure for general qualifiers, including the rdf:value element. The element and attribute forms may be mixed.
Emphasis mine.
The code diff is only one line, but I also added two tests: one comparison test to check general XMP generation for PDF/A+UA files, and one more granular test to specifically check whether the URI is serialised using rdf:resource, and not as an XMP text value.
(@michaeldemey this is the thing we briefly discussed at the airport today)