latex3 / tagpdf

Tagging support code for LaTeX
60 stars 7 forks source link

Feature request: possibility to create RoleMap in the output PDF #30

Closed bdoubrov closed 4 years ago

bdoubrov commented 4 years ago

One of the latest recommendations of PDF Association: https://www.pdfa.org/how-to-tag-titles-in-pdf-documents/ recommends using custom tag <Title> for document title with role mapping to <P>. It would be great have possibility implementing such recommendation in tagpdf.

u-fischer commented 4 years ago

This works already

\documentclass{article}
\usepackage{tagpdf}
\tagpdfsetup{
  activate-all,
  add-new-tag=Title/P,
  uncompress,}
\pagestyle{empty}
\begin{document}
\tagstructbegin{tag=Document}
\tagstructbegin{tag=Title}
\tagmcbegin{tag=Title}
Title
\tagmcend
\tagstructend
\tagstructend
\end{document}

gives a Title Structure Element, and a rolemap object with

3 0 obj
<</Title /P
>>
<< /Type /StructTreeRoot /K 4 0 R /ParentTree 2 0 R /RoleMap 3 0 R>>
bdoubrov commented 4 years ago

Thanks a lot! I missed this in the documentation