From f45d5c69a1891adff596350eaf5a16354e0fcd1b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 20 Jun 2014 18:19:43 +0000 Subject: animate (7jun14) git-svn-id: svn://tug.org/texlive/trunk@34335 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/animate/ChangeLog | 3 + Master/texmf-dist/doc/latex/animate/animate.pdf | Bin 3696671 -> 3685840 bytes Master/texmf-dist/doc/latex/animate/animate.tex | 8 +- Master/texmf-dist/tex/latex/animate/animate.sty | 171 ++++++++++++++---------- 4 files changed, 109 insertions(+), 73 deletions(-) diff --git a/Master/texmf-dist/doc/latex/animate/ChangeLog b/Master/texmf-dist/doc/latex/animate/ChangeLog index 723d0406649..2c99f04fe3b 100644 --- a/Master/texmf-dist/doc/latex/animate/ChangeLog +++ b/Master/texmf-dist/doc/latex/animate/ChangeLog @@ -1,3 +1,6 @@ +2014-06-04 + * fix: OCG related compatibility issue with media9 package + 2014-03-25 * fix: bugs related to AcroForm and OCProperties catalog entries; documenation diff --git a/Master/texmf-dist/doc/latex/animate/animate.pdf b/Master/texmf-dist/doc/latex/animate/animate.pdf index e3f2910fb0e..4a65bcc21d0 100644 Binary files a/Master/texmf-dist/doc/latex/animate/animate.pdf and b/Master/texmf-dist/doc/latex/animate/animate.pdf differ diff --git a/Master/texmf-dist/doc/latex/animate/animate.tex b/Master/texmf-dist/doc/latex/animate/animate.tex index 3cac96013ea..f64b5794861 100644 --- a/Master/texmf-dist/doc/latex/animate/animate.tex +++ b/Master/texmf-dist/doc/latex/animate/animate.tex @@ -9,8 +9,8 @@ \usepackage[UKenglish]{babel} \usepackage{pst-3dplot} \usepackage{pst-node,pst-plot,pst-tools,pst-text,pst-ode} -\usepackage{animate} \usepackage{media9} +\usepackage{animate} \usepackage{intcalc} \usepackage{graphicx} \graphicspath{{files/}} @@ -84,7 +84,7 @@ \def\@anim@sanitize{}\def\@anim@endsanitize{} \expandafter\parsedate\@anim@version\relax %set current date to package date \makeatother -\author{Alexander Grahn \animategraphics[autoplay,loop,height=1.8ex]{8}{bye_}{0}{3}\protect\footnote{Animated GIF taken from \href{http://www.phpBB.com}{phpBB} forum software and burst into a set of EPS files using \href{http://www.imagemagick.org}{ImageMagick} before embedding.} \protect\footnote{Animations may run slowly if viewed in the Adobe Reader browser plugin.} \protect\footnote{In PDF-XChange, animations are rendered upside-down if the document was produced via the {\tt dvips}$\rightarrow${\tt ps2pdf} route.}\\[1ex]\includegraphics[height=2.7ex]{mailto}} +\author{Alexander Grahn \animategraphics[autoplay,loop,height=1.8ex]{8}{bye_}{0}{3}\protect\footnote{Animated GIF taken from \href{http://www.phpBB.com}{phpBB} forum software and burst into a set of EPS files using \href{http://www.imagemagick.org}{ImageMagick} before embedding.} \protect\footnote{Animations may run slowly if viewed in the Adobe Reader browser plugin.}\\[1ex]\includegraphics[height=2.7ex]{mailto}} \maketitle \endgroup \begin{abstract} @@ -451,7 +451,7 @@ or \end{verbatim} `\verb+anim+' is an array of animation object references. Animations must be labelled using the `\verb+label=...+' command option in order to be present in the `\verb+anim+' array. As usual, properties and methods are accessed via the dot notation. Properties and methods of the animation object are summarized in Tables \ref{tab:props} and \ref{tab:methods}. -One potential use of the JavaScript interface could be within a timeline file associated with an animation. For example, loops over a sub-range of frames can be programmed by setting the `\verb+pageNum+' property. See Section~\ref{sect:timeline}, p.~\pageref{sect:jsfield} for details. +One potential use of the JavaScript interface could be within a timeline file associated with an animation. For example, loops over a sub-range of frames can be programmed by setting the `\verb+frameNum+' property. See Section~\ref{sect:timeline}, p.~\pageref{sect:jsfield} for details. Also, the programming interface can be used to create custom buttons for playback control. The command \verb+\mediabutton+ from the `media9' package provides a convenient way for achieving this: \begin{verbatim} @@ -1299,7 +1299,7 @@ I would like to thank Fran\c{c}ois Lafont who discovered quite a few bugs and ma \bibitem{gilg05} Gilg, J.: PDF-Animationen. In: \emph{Die \TeX nische Kom\"odie}, Issue 4, 2005, pp.~30--37 \bibitem{hol} Hole\v{c}ek, J.: \emph{Animations in a pdf\TeX-generated PDF}. URL: \url{http://www.fi.muni.cz/~xholecek/tex/pdfanim.xhtml} \bibitem{luque12} Luque, M.: \emph{PSTricks : applications.} URL: \url{http://pstricks.blogspot.com} -\bibitem{media9} \emph{The media9 Package}. URL: \url{http://www.ctan.org/tex-archive/macros/latex/contrib/media9/} +\bibitem{media9} \emph{The media9 Package}. URL: \url{http://www.ctan.org/pkg/media9} \end{thebibliography} \end{document} diff --git a/Master/texmf-dist/tex/latex/animate/animate.sty b/Master/texmf-dist/tex/latex/animate/animate.sty index 6c9dbcc4854..195926d2313 100644 --- a/Master/texmf-dist/tex/latex/animate/animate.sty +++ b/Master/texmf-dist/tex/latex/animate/animate.sty @@ -13,7 +13,7 @@ \NeedsTeXFormat{LaTeX2e} -\def\@anim@version{2014/03/25} +\def\@anim@version{2014/06/04} \ProvidesPackage{animate} [\@anim@version\space PDF animations from files and inline graphics] @@ -250,7 +250,7 @@ \AtEndDvi{% \ifx\empty\@anim@ocgs\empty\else% \immediate\pdfobj{[\@anim@ocgs]}% - \edef\@anim@@ocgss{\the\pdflastobj}% + \edef\@anim@@ocgs{\the\pdflastobj}% \immediate\pdfobj{[\@anim@offocgs]}% \edef\@anim@@offocgs{\the\pdflastobj}% \pdfcatalog{% @@ -258,6 +258,11 @@ /OCGs \@anim@@ocgs\space 0 R% /D <<% /BaseState/ON /OFF \@anim@@offocgs\space 0 R% + /AS [% + <>% + <>% + <>% + ]% >>% >>% }% @@ -295,7 +300,14 @@ \special{pdf:put @catalog <<% /OCProperties <<% /OCGs @anim@ocgs - /D <> + /D << + /BaseState/ON /OFF @anim@offocgs% + /AS[% + <>% + <>% + <>% + ]% + >>% >>% >>}% \fi% @@ -332,7 +344,14 @@ mark {Catalog} <<% /OCProperties <<% /OCGs {@anim@ocgs}% - /D <>% + /D <<% + /BaseState/ON /OFF {@anim@offocgs}% + /AS[% + <>% + <>% + <>% + ]% + >>% >>% >> /PUT pdfmark% }% @@ -463,9 +482,9 @@ \def\@anim@xinline#1#2#3#4{% \ifthenelse{\equal{#4}{!}}{% %put graphics into XObject - \global\setbox\@anim@box=\hbox{% - \raisebox{-\dp#3}[\@anim@frameheight\p@][\@anim@framedepth\p@]{\box#3}% - }% + %\global\setbox\@anim@box=\hbox{% + % \raisebox{-\dp#3}[\@anim@frameheight\p@][\@anim@framedepth\p@]{\box#3}% + %}% \immediate\pdfxform resources {\the\pdfpageresources}\@anim@box% \xdef\@anim@lastxform{\the\pdflastxform}% %keep a record of XObject number @@ -473,11 +492,7 @@ }{% \@anim@newkey{img@#2}{#4\space 0 R}% }% - \if@anim@timeline\else% - \@anim@newkey{frmxobject@#2}{/im#2\space\@anim@getkeyval{img@#2}}% - \@anim@newkey{frmcontent@#2}{ q /im#2\space Do Q}% - \@anim@makeframe{#1}{#2}% - \fi% + \if@anim@timeline\else\@anim@makeframe{#1}{#2}\fi% } \else \if@anim@@dvipdfmx @@ -510,11 +525,7 @@ }{% \@anim@newkey{img@#2}{#4}% }% - \if@anim@timeline\else% - \@anim@newkey{frmxobject@#2}{/im#2\space\@anim@getkeyval{img@#2}}% - \@anim@newkey{frmcontent@#2}{ q /im#2\space Do Q}% - \@anim@makeframe{#1}{#2}% - \fi% + \if@anim@timeline\else\@anim@makeframe{#1}{#2}\fi% } \else \def\@anim@xinline#1#2#3#4{% @@ -592,11 +603,7 @@ }{% \@anim@newkey{img@#2}{{#4}}% }% - \if@anim@timeline\else% - \@anim@newkey{frmxobject@#2}{/im#2\space\@anim@getkeyval{img@#2}}% - \@anim@newkey{frmcontent@#2}{ q /im#2\space Do Q}% - \@anim@makeframe{#1}{#2}% - \fi% + \if@anim@timeline\else\@anim@makeframe{#1}{#2}\fi% } \fi \fi @@ -633,18 +640,20 @@ %non-interactive Widget annotation, representing one frame of the animation \ifpdf \def\@anim@makeframe#1#2{% #1:@anim@num, #2:@anim@curframe@zb - %container XObject for all transparencies that compose the frame - \begingroup% - \setlength{\unitlength}{1pt}% - \global\setbox\@anim@box=\hbox{% - \pdfliteral{q}% - \begin{picture}(\@anim@framewidth,\@anim@frametotalheight)% - \end{picture}% - \pdfliteral{Q\@anim@getkeyval{frmcontent@#2}}% - }% - \endgroup% - \immediate\pdfxform resources {% - /XObject <<\@anim@getkeyval{frmxobject@#2}>>}\@anim@box% + \if@anim@timeline% + %container XObject for all transparencies that compose the frame + \begingroup% + \setlength{\unitlength}{1pt}% + \global\setbox\@anim@box=\hbox{% + \pdfliteral{q}% + \begin{picture}(\@anim@framewidth,\@anim@frametotalheight)% + \end{picture}% + \pdfliteral{Q\@anim@getkeyval{frmcontent@#2}}% + }% + \endgroup% + \immediate\pdfxform resources {% + /XObject <<\@anim@getkeyval{frmxobject@#2}>>}\@anim@box% + \fi% \if@anim@useocg% \@anim@newocg{#1}{#2}% \ifx\@anim@poster\@anim@posterlast% @@ -679,7 +688,8 @@ \fi% \fi% \fi% - %frame widget, using the container XObject as its Appearance + %frame widget, using an XObject (timeline: container, else: single image) + %as its Appearance \pdfannot width \@anim@animwidth\p@ height \@anim@animheight\p@ depth \@anim@animdepth\p@ @@ -691,8 +701,13 @@ \fi% /FT/Btn/Ff 65537% non-interactive push button /BS <>% - /AP <>% - /MK <>>>% + \if@anim@timeline% + /AP <>% + /MK <>>>% + \else% + /AP <>% + /MK <>>>% + \fi% /T (#1.#2)% }% \xdef\@anim@fields{\@anim@fields\the\pdflastannot\space 0 R\space}% @@ -700,17 +715,19 @@ \else \if@anim@@dvipdfmx \def\@anim@makeframe#1#2{% - %container XObject - \global\setbox\@anim@box=\hbox{% - \special{pdf:content \@anim@getkeyval{frmcontent@#2}}% - }% - \special{pdf:bxobj @anim@anmfrm@#1@#2 width \@anim@framewidth pt - height \@anim@frameheight pt depth \@anim@framedepth pt}% - \begin{picture}(0,0)\put(0,0){\box\@anim@box}\end{picture}% - \special{pdf:put @resources << - /XObject <<\@anim@getkeyval{frmxobject@#2}>>% - >>}% - \special{pdf:exobj}% + \if@anim@timeline% + %container XObject + \global\setbox\@anim@box=\hbox{% + \special{pdf:content \@anim@getkeyval{frmcontent@#2}}% + }% + \special{pdf:bxobj @anim@anmfrm@#1@#2 width \@anim@framewidth pt + height \@anim@frameheight pt depth \@anim@framedepth pt}% + \begin{picture}(0,0)\put(0,0){\box\@anim@box}\end{picture}% + \special{pdf:put @resources << + /XObject <<\@anim@getkeyval{frmxobject@#2}>>% + >>}% + \special{pdf:exobj}% + \fi% \if@anim@useocg% \@anim@newocg{#1}{#2}% \ifx\@anim@poster\@anim@posterlast% @@ -753,8 +770,13 @@ \if@anim@useocg/OC @anim@ocg@#1@#2\fi% /FT/Btn/Ff 65537% /BS <>% - /AP <>% - /MK <>>>% + \if@anim@timeline% + /AP <>% + /MK <>>>% + \else% + /AP <>% + /MK <>>>% + \fi% /T (#1.#2)% >>% }% @@ -763,17 +785,19 @@ } \else \def\@anim@makeframe#1#2{% - %container XObject - \special{ps: - mark /_objdef {@anim@anmfrm@#1@#2} /type/stream /OBJ pdfmark - mark {@anim@anmfrm@#1@#2} (\@anim@getkeyval{frmcontent@#2}) /PUT - pdfmark - mark {@anim@anmfrm@#1@#2} << - /Type/XObject/Subtype/Form/FormType 1 - /BBox [frame@llx frame@lly frame@urx frame@ury] - /Resources <>>> - >> /PUT pdfmark% - }% + \if@anim@timeline% + %container XObject + \special{ps: + mark /_objdef {@anim@anmfrm@#1@#2} /type/stream /OBJ pdfmark + mark {@anim@anmfrm@#1@#2} (\@anim@getkeyval{frmcontent@#2}) /PUT + pdfmark + mark {@anim@anmfrm@#1@#2} << + /Type/XObject/Subtype/Form/FormType 1 + /BBox [frame@llx frame@lly frame@urx frame@ury] + /Resources <>>> + >> /PUT pdfmark% + }% + \fi% \if@anim@useocg% \@anim@newocg{#1}{#2}% \ifx\@anim@poster\@anim@posterlast% @@ -832,8 +856,13 @@ \if@anim@useocg/OC {@anim@ocg@#1@#2}\fi% /FT/Btn/Ff 65537 /BS <>% - /AP <>% - /MK <>>>% + \if@anim@timeline% + /AP <>% + /MK <>>>% + \else% + /AP <>% + /MK <>>>% + \fi% /T (#1.#2)% /ANN pdfmark% }% @@ -1008,19 +1037,23 @@ } \def\@anim@xbutton#1#2#3{% #1: name; #2: stroking commands, #3 @anim@num \special{ps: - gsave [1 0 0 1 0 0] setmatrix + gsave + %[1 0 0 1 0 0] setmatrix mark /_objdef {btn#1:#3} /BBox [0 0 15 15] /BP pdfmark {% %landscape mode (powerdot, geometry /w landscape option) - isls{% - [0 -1 1 0 0 15] concat % rotate by 270 degrees - [-1 0 0 1 15 0] concat% flip around vertical axis - }if + %isls{% + % [0 -1 1 0 0 15] concat % rotate by 270 degrees + % [-1 0 0 1 15 0] concat% flip around vertical axis + %}if #2 - }?pdfmark mark /EP pdfmark + }?pdfmark + mark /EP pdfmark + % this avoids the `[1 0 0 1 0 0] setmatrix' and `isls{}{}if' codes above + mark {btn#1:#3} <> /PUT pdfmark grestore% }% } -- cgit v1.2.3