[pdftex] Pop-ups in PDF files

Hans Hagen pragma at wxs.nl
Thu Sep 1 22:17:37 CEST 2005

Piet van Oostrum wrote:

>I need to make a PDF document with pdflatex, where the user can click at
>certain points to have additional information pop up. In the actual case
>the pop-up will contain source code that is connected to the click
>>From what I have read in the PDF reference manual I see three
>1. Annotations. These have the disadvantage that they can only contain
>   plain text. No layout whatsoever. They can appear in a separate
>   `window'.
yes and no; some can have user defined appearances but they are of not 
much use for your purpose

>2. Optional Content groups (layers). AFAIK these can only appear inside the
>   main window of the document. I wonder if you can pop up an OCG in such a
>   way that it hides the page contents underneath it without explicitely
>   disabling the contents underneath (if the contents is text). If not,
>   then it isn't usable for my purpose. I have only seen examples like
>   drawings, where the layers were used to supply more detail, and slides
>   where pieces of text where switched on/off.
just give the thing a background color similar to the page background 
color an dit will obscure the underlying text

>3. An embedded PDF file with file annotations or link annotations pointing
>   to a page in the embedded file. This would give full formatting
>   possibilities and separate windows if I want. I wonder if there are
>   disadvantages of this approach. Alternatively I could use a separate
>   embedded PDF file for each pop-up.
>Please let me know what your experiences are, and if you have some examples
>and/or code to share I would appreciate that.
this kind of things are already possible for quite a while in 
pdf/acrobat: just make a widget (e.g. a push or check button), give it 
an appearance (xform) and turn it on or off with a javascript-one-liner 
or an associated annotation;


                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl

More information about the pdftex mailing list