3

Since my last update of Texlive, I have conflict when loading animate and exerquiz in the same document: the document compiles, the animation plays well in Acrobat, but when I open the pdf with another reader (evince, okular,...) that do not support animations, I have only a white rectangle in place of my animation, instead of the first frame.

MWE:

\documentclass{standalone} 
\usepackage{animate}
%\usepackage{exerquiz} % uncomment this line and the animation preview disappear

\begin{document}

Watch this counter:\begin{animateinline}[loop,autoplay,poster=0,controls]{2} \multiframe{10}{in=0+1}{% \fbox{\in} } \end{animateinline}

\end{document}

When I compile this MWE, and open it in evince, I see the counter 0 in the fbox, and the controls beneath.

When I uncomment the \usepackage{exerquiz} line and compile this MWE, and open it with evince, I see nothing except "Watch this counter:"; but in Acrobat the animation still plays.

This did not happen before I updated Texlive; I always saw the first frame in evince. How can I restore the old behaviour?

JPG
  • 2,019
  • Strange observation: when I open with evince a pdf file generated 3 months ago in the same conditions, the animation preview doesn't display; while it did 3 months ago. So it is not a question of Texlive update. Is this problem related to the end of Flash support? – JPG Feb 15 '21 at 07:46

1 Answers1

3

At some point in the loading chain of packages, hyperref is invoked in a way that puts the key /NeedAppearances true in the AcroForm dictionary of the PDF Catalog. NeedAppearances is declared deprecated in the current ISO PDF-2.0 standard.

Also, animate and hyperref concurrently want to write the Fields entry in the AcroForm dictionary, if hyperref's Form environment is set (implicitly done by exerquiz).

The following fix suppresses NeedAppearances in the PDF output and hooks into hyperref's mechanism of Form field registration:

\documentclass{standalone}

\usepackage{animate} \usepackage{exerquiz}

\begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Fix compatibility with hyperref Forms %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ExplSyntaxOn \makeatletter % suppress deprecated /NeedAppearances true|false \HyField@NeedAppearancesfalse % hook into hyperref's Form Field registration \cs_set_protected_nopar:Nn\pbs_appendtofields:n{ \tl_gput_left:Nx\HyField@afields{#1\space} } \makeatother \ExplSyntaxOff %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Watch this counter:\begin{animateinline}[loop,autoplay,controls]{2} \multiframe{10}{in=0+1}{% \fbox{\in} } \end{animateinline}

\end{document}

AlexG
  • 54,894