Forum Bugs

Changing PdfProfile.PdfA_3A_And_PdfUA_1 to PdfProfile.PdfUA_1 messes up Encoding for language metadata

vgvgvg
Hi everyone,

We recently added encryption to our generated PDFs, and since PDF/A doesn’t support encryption, we had to switch our output profile from PdfProfile.PdfA_3A_And_PdfUA_1 to PdfProfile.PdfUA_1.

However, after the switch, our PDFs now fail the PAC test with the following error:
"PDF/UA Document Language Metadata Contains a Syntax Error"

The document language metadata should always be "de", as specified in our HTML. Instead, the metadata now contains corrupted characters, for example:

˙™

“t

When we use PdfProfile.PdfA_3A_And_PdfUA_1, everything works correctly — the language metadata is "de" as expected.

We’re using PrinceXML together with the C# wrapper, and the HTML looks fine before ConvertString is called.

Has anyone encountered a similar issue or knows what could cause the language metadata to get corrupted? I can send the template privately if that helps.

Thanks in advance,
Valentin

Edited by vgvgvg

wangp
The document language metadata refers to the Lang entry in the document catalog dictionary, which is a string value. With few exceptions, all strings in an encrypted PDF document must be encrypted - that is what you are seeing. PAC is treating the encrypted Lang value as though it was plaintext.