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/UA and WCAG compliance issue with embedded files (attachments) #977

Open
osnard opened this issue Jul 29, 2024 · 0 comments
Open

PDF/UA and WCAG compliance issue with embedded files (attachments) #977

osnard opened this issue Jul 29, 2024 · 0 comments

Comments

@osnard
Copy link

osnard commented Jul 29, 2024

I need to create WCAG and PDF/UA compliant PDF from HTML. Therefore I have followed the instructions on https://github.com/danfickle/openhtmltopdf/wiki/PDF-Accessibility-(PDF-UA,-WCAG,-Section-508)-Support

It already works really well! Thanks for this awesome library!

I then added attachment files as described here: https://github.com/danfickle/openhtmltopdf/wiki/Embedding-downloadable-files

Unfortunately, this causes the following errors in the validation tool I am using (PAC 2021):

Issue 1

image
Sorry, german version of PAC. It basically reads "PDF document not readable (Operator 'CS' not allowed in this current state".

I have checked the PDF file in an editor, but did not find any occurrence of CS.

Issue 2

image
This one reads: "Annotation not within a 'Annot' structure element"

30 0 obj
<<
/Type /Annot
/Subtype /FileAttachment
/FS 320 0 R
/AP 321 0 R
/AF [320 0 R]
/Rect [49.612503 603.1875 160.3125 619.05]
/F 4
/BS 322 0 R
/StructParent 15
>>
endobj

I guess /StructParents 0 in

9 0 obj
<<
/Type /Page
/MediaBox [0.0 0.0 595.275 841.875]
/Parent 2 0 R
/Contents 25 0 R
/Resources 26 0 R
/Annots [27 0 R 28 0 R 29 0 R 30 0 R 31 0 R 32 0 R 33 0 R 34 0 R 35 0 R 36 0 R
37 0 R 38 0 R 39 0 R 40 0 R 41 0 R 42 0 R]
/StructParents 0
/Tabs /S
>>
endobj

may cause the issue, but I don't know how to solve it.

The <a download=... element is only nested in body > p, without any further semantics. Maybe that's the issue.

<html>
    ...
    <body>
        ...
       <p>...</p>
       <p>
            <a ... href="attachments/Some_attachment.docx" ... download="" ...>Some attachment link</a>
        </p>
        ...

Any ideas or hints? If you can help me understand the issue, I may be able to provide a patch, in case it is related to the library code rather than to my code.

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

1 participant