diff options
author | Karl Berry <karl@freefriends.org> | 2008-03-08 17:37:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-03-08 17:37:09 +0000 |
commit | 2f22084ef856c7992c473c4ff3b5723fbd66d181 (patch) | |
tree | faa3a4fbad14a230091cc9698d566dd2003f186b /Master/texmf-dist/tex/latex/animate | |
parent | c33c52f5267b5241fb4ca934a55a316869ace447 (diff) |
animate update (6mar08)
git-svn-id: svn://tug.org/texlive/trunk@6891 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/animate')
-rw-r--r-- | Master/texmf-dist/tex/latex/animate/animate.sty | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/latex/animate/animate.sty b/Master/texmf-dist/tex/latex/animate/animate.sty index d434237a8b3..7d1f0e770f4 100644 --- a/Master/texmf-dist/tex/latex/animate/animate.sty +++ b/Master/texmf-dist/tex/latex/animate/animate.sty @@ -1,4 +1,4 @@ -% Copyright 2007 Alexander Grahn +% Copyright 2007--2008 Alexander Grahn % This material is subject to the LaTeX Project Public License. See % http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html @@ -13,7 +13,7 @@ % Supports LaTeX->dvips->ps2pdf or pdfLaTeX workflows. \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{animate}[2008/01/03] +\ProvidesPackage{animate}[2008/03/05] \RequirePackage{keyval} \RequirePackage{ifthen} \RequirePackage{ifpdf} @@ -100,8 +100,11 @@ }{}% } -%add OCProperties dict to Catalog +%add AcroForm and OCProperties entries to Catalog \ifpdf + \newcount\@anim@@fields + \pdfobj reserveobjnum + \@anim@@fields=\pdflastobj \newcount\@anim@@ocgs \pdfobj reserveobjnum \@anim@@ocgs=\pdflastobj @@ -109,15 +112,24 @@ \pdfobj reserveobjnum \@anim@@posterocgs=\pdflastobj \pdfcatalog{ + /AcroForm << + /Fields \the\@anim@@fields\space 0 R + >> /OCProperties << /OCGs \the\@anim@@ocgs\space 0 R - /D <</BaseState/OFF /ON \the\@anim@@posterocgs\space 0 R - /Order \the\@anim@@ocgs\space 0 R>> + /D << + /BaseState/OFF /ON \the\@anim@@posterocgs\space 0 R + /Order \the\@anim@@ocgs\space 0 R + >> >> } + \def\@anim@fields{} \def\@anim@ocgs{} \def\@anim@posterocgs{} \AtEndDocument{% + \immediate\pdfobj useobjnum \@anim@@fields {% + [\@anim@fields]% + }% \immediate\pdfobj useobjnum \@anim@@ocgs {% [\@anim@ocgs]% }% @@ -126,12 +138,19 @@ }% }% \else + % counts inserted interactive fields (widget annots) + \newcount\@anim@fieldnum\@anim@fieldnum=0 \special{ps: + % array which takes refs to all widget annotations + mark /_objdef {@anim@fields} /type/array /OBJ pdfmark % array which takes all ocgs (one per animation frame) mark /_objdef {@anim@ocgs} /type/array /OBJ pdfmark % array which takes ocgs shown by default (the poster frames) mark /_objdef {@anim@posterocgs} /type/array /OBJ pdfmark mark {Catalog} << + /AcroForm << + /Fields {@anim@fields} + >> /OCProperties << /OCGs {@anim@ocgs} /D <</BaseState/OFF /ON {@anim@posterocgs} /Order {@anim@ocgs}>> @@ -144,9 +163,9 @@ \newdimen\@anim@tmpdima %length registers for occasional use \newdimen\@anim@tmpdimb -%tests whether file is known, if so it returns identifier of form xobj -%otherwise `!' -\def\@anim@fileknown#1#2{% #1 file name, #2 page No +%tests whether file is already known (and embedded), if so it returns identifier +%of xobj, otherwise returns `!' +\def\@anim@fileknown#1#2{% #1 file name, #2 page No. %identify file by md5sum \expandafter\ifx\csname file:\pdfmdfivesum file {#1}.#2\endcsname\relax!% \else\@anim@getkeyval{file:\pdfmdfivesum file {#1}.#2}\fi% @@ -1265,6 +1284,7 @@ \@anim@otherjscriptkey% >>% }% + \xdef\@anim@fields{\@anim@fields\space\the\pdflastannot\space 0 R}% \hbox to \@anim@animwidth\p@ {% \vrule width 0pt height \@anim@animheight\p@ depth \@anim@animdepth\p@% \hss% @@ -1297,6 +1317,7 @@ \fi \special{ps: mark + /_objdef {annot@\the\@anim@fieldnum}% /Rect [wid@llx wid@lly wid@urx wid@ury]% /Subtype/Widget% /F 4% @@ -1310,7 +1331,9 @@ \@anim@otherjscriptkey% >>% /ANN pdfmark + mark {@anim@fields} {annot@\the\@anim@fieldnum} /APPEND pdfmark }% + \global\advance\@anim@fieldnum by \@ne% \hbox to \@anim@animwidth\p@ {% \vrule width 0pt height \@anim@animheight\p@ depth \@anim@animdepth\p@% \hss% @@ -1338,6 +1361,7 @@ /T (btn@#1@#2)% /A <</S/JavaScript/JS (\@anim@upjscriptstring)>>% }% + \xdef\@anim@fields{\@anim@fields\space\the\pdflastannot\space 0 R}% \vrule width 0pt height \@anim@tmpdima depth 0pt% \hss% }% @@ -1370,7 +1394,9 @@ /T (btn@#1@#2)% /A <</S/JavaScript/JS (\@anim@upjscriptstring)>>% /ANN pdfmark + mark {@anim@fields} {annot@\the\@anim@fieldnum} /APPEND pdfmark }% + \global\advance\@anim@fieldnum by \@ne% \hbox to \the\@anim@tmpdima {% \vrule width 0pt height \the\@anim@tmpdima\space depth 0pt% \hss% |