4

I'm trying to inject page metadata into a PDF generated with ConTeXt so that the pages have their tabbing order set to use the document structure (for accessibility checks).

Currently, I can inject the metadata but only on the current page of the document.

\startluacode 
    lpdf.addtopageattributes("Tabs", lpdf.constant("S")) 
\stopluacode

This sets the tab order of one page, however, I can't seem to find a way to loop through every page in the document and re-run the code for each one. Is there an efficient way to do this?

4

To have certain stuff happen on every page you can use the \beforeeverypage and \aftereverypage hooks (or maybe \everyshipout?)

\appendtoks
    \startluacode 
        lpdf.addtopageattributes("Tabs", lpdf.constant("S")) 
    \stopluacode
\to \beforeeverypage % or \aftereverypage (try it out)

It might be possible to do this in a LuaTeX callback as well, I'll have a look.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.