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

PDF/A-1b validation failed when generating PDF with image #2182

Closed
julien-gonzalez opened this issue Jun 13, 2024 · 2 comments
Closed

PDF/A-1b validation failed when generating PDF with image #2182

julien-gonzalez opened this issue Jun 13, 2024 · 2 comments

Comments

@julien-gonzalez
Copy link

Hello,

Following issue #2175, I'm trying to generate PDF/A-1b documents.
I've stumbled upon a problem, when I include an image in my document.

I've tested my case against both WeasyPrint v62.2 and main, using the following command :
weasyprint --pdf-variant pdf/a-1b --pdf-identifier 043ff313-a121-4bb0-a24a-872c3d7b0b32 simple-page.html result.pdf

In both versions, the generated document doesn't pass PDF/A-1 validation (against https://demo.verapdf.org/).

Case in v62.2 : case-62-2.zip
Case in main branch : case-main.zip

The 2 following rules are problematic :

Rule 6.4-2

An XObject dictionary shall not contain the SMask key

Rule 6.2.4-3

If an Image dictionary contains the Interpolate key, its value shall be false

Thank you for your help and the work you're doing to improve PDF/A-1 support.

@liZe
Copy link
Member

liZe commented Jun 14, 2024

Hi!

The two problems are a bit different.

  • Rule 6.2.4-3 is actually covered by Automatically set required options to get valid PDF/A documents #1661: using html { image-rendering: crisp-edges } will fix the problem. We should set this automatically for PDF/A generation, but it’s not done yet. At least the workaround should be easy to apply for you.

  • Rule 6.4-2 is more complicated. PDF/A-1 doesn’t allow the use of transparent images, contrary to PDF/A-2. If you have the possibility to modify images before they’re integrated in your HTML file, the best solution would be to remove the alpha channel from your images before calling WeasyPrint. Otherwise, it’s probably possible to do this with a custom URL fetcher in WeasyPrint with Pillow. In both cases, you’ll have to find a solution if your documents actually need this transparency.

@liZe
Copy link
Member

liZe commented Jul 3, 2024

Let’s track these problems in #1661! We should at least advertise about unsupported features in different PDF/A and PDF/UA versions when generating documents.

@liZe liZe closed this as not planned Won't fix, can't repro, duplicate, stale Jul 3, 2024
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