I looked up for different solutions about how to include alternative text for images in LuLaTeX (1.17.0). I found the following solution
\documentclass[a4paper,11pt,naustrian]{article}
\usepackage{accsupp}
\usepackage{graphicx}
\begin{document}
123
\BeginAccSupp{method=escape, ActualText=2. Tag \%4,space}
\EndAccSupp{}
\includegraphics{img.png}%
66
\BeginAccSupp{method=plain, ActualText=abc\%4,space}
\includegraphics{img.png}%
\EndAccSupp{}
\end{document}
Some questions with the above code:
I am not clear if the
\BeginAccSupp
and\EndAccSupp
should include the graphic or not. I didn't find a comment in the documentation. I'm thinking it might get tricky with the placement of image across pages.When I read the documentation of
accsupp
I read that the methodplain
might result in invalid PDF files since special chars are not protected. Does anybody know what special chars are referred to? I was thinking about the%
but obviously this is double escaped in the PDF file:ET /Span<</ActualText(2.\040Tag\040\\%4)>>BDC BT
Is there a way to correct it?
Reading the documentation I can use as well
pdfliteral
s. But somehow I didn't succeed with - is there a way to correct it?\BeginAccSupp{pdfliteral=direct} \pdfextension literal direct{/ActualText(2. Tag \%4)} \EndAccSupp{}
end in
/Span<<>>BDC
/ActualText(2. Tag \%4)
ET
EMC
- Is it better use the package options or encode by oneself the pdfstring and use
pdfliteral
? (once I have a working sample)