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

Support for element grouping #738

Closed
AndreasJacobsen opened this issue Jul 26, 2021 · 3 comments
Closed

Support for element grouping #738

AndreasJacobsen opened this issue Jul 26, 2021 · 3 comments

Comments

@AndreasJacobsen
Copy link

I am generating a very long pdf (100+ pages) and I want to group elements in this pdf using standard PDF grouping tags.

These are Part, Art, Sect, Div

See pdfa.org for more information.

I tried searching for any documentation on how to use standard PDF tags but found none, so I tried to guess the tags. I wrote the following HTML

<html lang="EN-US">
<style>
                body {
    font-family: 'TestFont';
                }
    </style>
<body>
<h1>Testdokument</h1>
<section>
 <p>Section</p>
</section>
<Section>
 <p>Section</p>
</Section>
<sect>
 <p>sect</p>
</sect>
<Sect>
 <p>Sect</p>
</Sect>
<Art>
 <p>Art</p>
</Art>
<art>
 <p>art</p>
</art>
<part>
 <p>part</p>
</part>
<Part>
 <p>Part</p>
</Part>
</body>
</html>

This HTML produces the following tag tree, no section, part or art tags are present.
tag tree showing none of the pdf tags used

Attached bellow is a screenshot of a PDF that contains the use of the Sect-elemt, this is what I want.
Screenshot of tag tree with section tags

Are PDF tag grouping not supported?
Grouping can drasticly increase ease of use, especially in long documents, for a wide range of users of assistive technologies.

I've set my conformance level to PDFA_3_A
builder.usePdfAConformance(PdfRendererBuilder.PdfAConformance.PDFA_3_A);

@danfickle
Copy link
Owner

danfickle commented Jul 31, 2021

Hi @AndreasJacobsen,

I've just added support for art, part, sect, section (alias for sect), caption and blockquote tags in 7ab966e. You can use art currently with <article> and you may be able to use sect with position: relative CSS as it uses sect for out-of-flow content.

@AndreasJacobsen
Copy link
Author

I'll make a pull request for the wiki once I have tested this, thanks danfickle!

My Java skills are sadly pretty much non-existent so I'll wait till this is merged to main and I can update my maven packages to test and document.

@AndreasJacobsen
Copy link
Author

Any idea when this will be available on Maven @danfickle? I don't want you to rush it, I just need to do some planning :)

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