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

WeasyPrint 57.1 "Hello World"HTML targeted to PDF/A-1b produces output that fails PDF/A-1b validation - "file trailer dictionary shall contain the ID keyword" #1766

Closed
paulbarron1 opened this issue Nov 16, 2022 · 2 comments

Comments

@paulbarron1
Copy link

Hi.
I was excited to see the latest versions of WeasyPrint support option to produce PDF output for a variety of PDF/A standards.

However, I can't get the resulting PDF/A output to validate successfully, and have tried several PDF/A validators with the same validation error reported.

The execution trace reports that WeasyPrint's PDF/A feature option is an experimental new feature and asks that any issues be reported thus ;
WARNING: PDF/A support is experimental, generated PDF files are not guaranteed to be valid. Please open an issue if you have problems generating PDF/A files.

I have tried several inputs , all with the same validation error reported , including on a "Hello World" HTML input.
hello-world-htmlinput-pdfa1b-output.zip

Input HTML and PDF/A-1b output in referenced file"hello-world-htmlinput-pdfa1b-output.zip"

I used WeasyPrint 57.1 , requesting PDF/A-1b thus ;
weasyprint.exe --pdf-variant pdf/a-1b hello-world.html hello-world.pdf

Resulting PDF was interpreted correctly as PDF/A-1b , but failed validation on PDF/A Validators
https://demo.verapdf.org/
https://tools.pdfforge.org/en/validate-pdfa

Both reported the same PDF/A-1b validation error
Specification ISO 19005-1:2005
Clause 6.1.3
Description
The file trailer dictionary shall contain the ID keyword. The file trailer referred to is either the last trailer dictionary in a PDF file, as described in PDF Reference 3.4.4 and 3.4.5, or the first page trailer in a linearized PDF file, as described in PDF Reference F.2

@liZe
Copy link
Member

liZe commented Nov 17, 2022

Hi!

Thanks for opening the issue.

You can add an identifier using the --pdf-identifier option, this should fix your problem!

We know that we should definitely improve WeasyPrint to check many things that are mandatory/forbidden with PDF/A, and set missing required values (like the ID) if needed. We can discuss that in #1661.

@paulbarron1
Copy link
Author

Hi liZe

Many thanks for your quick reply.

I can confirm that adding weasyprint option

--pdf-identifier NameOfIdentifier

..to the --pdf-variant pdf/a-1b request, does indeed produce PDF/A1-b compliant output.

I must admit I hadn't linked the two options , but can see that this should be covered by existing "set missing required PDF/A values" on #1661.

Thanks again for your help.

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

No branches or pull requests

2 participants