0

I'm trying to create a PDF using iText library. The PDF has to embed an animation, which is a set of bitmaps. And there are buttons to control the animation. To understand it, see the following file: http://www.texample.net/media/tikz/examples/PDF/wankel-motor.pdf

How can I create such a file from iText?

I know that I can embed a video file with this code: http://itextpdf.com/examples/iia.php?id=188

But here I don't want to embed a video file, but a set of bitmaps and to add the control buttons.

Thanks in advance,

V. Henley

2 Answers2

1

The document doesn't have any images. Instead it has a large series of Widget annotations inside a rectangle of which the lower-left and upper-right corners have the following coordinates:

llx = 4.981
lly = 287.238
urx = 322.053
ury = 542.754

These widget annotations are buttons that overlap each other and of which the appearance is defined using PDF syntax (paths consisting of straight lines and Bézier curves).

There are also a number of smaller buttons with arrows and other symbols. When clicking them, some JavaScript is executed:

enter image description here

The animations is actually JavaScript alternating the visibility of the different buttons. If you want to know more about the JavaScript that is used, you have to dig into the document using iText RUPS (which is what I did to create the above screen shot).

The principle that is used to create this PDF is identical to the principle that was used in the Calculator example, which is an example that was distributed with the same book you refer to.

Bruno Lowagie
  • 75,994
  • 9
  • 109
  • 165
0

Finally, I've been able to create such a PDF using latex code:

This is the latex code:

\documentclass[10pt]{article}

\usepackage{animate}

\usepackage{graphicx}

\usepackage{media9}

\pagestyle{empty}

\begin{document}

\AtEndDocument{%

\label{lastpage}%

}

\animategraphics[width=9.54cm,height=6.36cm,controls]{2}{C:/Users/casa/Documents/programacion/tex/construc_}{0}{3}

\end{document}

So after compiling such code with a latex compiler, it produces a pdf similar to the one I posted.

Kind Regards