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

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.
@yulian-gaponenko
Copy link
Member

Hi @MatthiasValvekens !

As always, thank you for your contribution!
Actually, we've merged your fix in 123a3d9 and is already a part of 8.0.4 release.

But apparently we haven't properly updated the status of this PR, sorry for that.
I'm going to closer this PR since the proposed changeset is already merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants