Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct XMP URI serialisation in PDF/UA ext schema #100

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

MatthiasValvekens
Copy link
Contributor

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)

URIs and text follow different conventions in the XMP data model. While
many parsers tolerate URIs encoded as text, it's technically not
allowed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant