0

I need an ocg for each character in the pdf-export to be able to import the pdf in after effects with each character as a separate layer. I'm looking for a solution where you don't have to write...

\begin{ocg}{First layer}{oc1}{1}
A
\end{ocg}...

... for each character in the document.

I've tried using pymupdf, but I can't find a good way to keep the embedded fonts (subsets) while creating ocgs.

Is there an easy way to do this in latex and keep the documents clean and readable?

  • Must it be done in LaTeX directly, or can you post-process the PDF using other software? The un-limited versions of Acrobat Pro and DC have the capability to OCR a PDF and add a layer (you can also correct spelling, where the OCR misses). But it would not reliably parse math expressions. – rallg Mar 22 '23 at 15:38
  • What is an OCG ? – Peter Wilson Mar 22 '23 at 17:55
  • @PeterWilson Optional Content Groups, the official name for "PDF Layers" in the document whose visibility can be set/unset by user action (via links in the document, switches in the viewer GUI) or by embedded JavaScript. – AlexG Mar 23 '23 at 09:49
  • @PeterWilson Usage example https://tex.stackexchange.com/a/492768 – AlexG Mar 23 '23 at 09:53
  • It can be done in a pdf post-process. But I need the font-subsets to get through that process. – Andreas Mar 24 '23 at 10:32

0 Answers0