[pdftex] pdf objects with references to each other?

Hans Hagen pragma at wxs.nl
Sat Mar 30 01:32:39 CET 2002

At 11:00 AM 3/30/2002 +1100, you wrote:
>I find that if I use pdftex to create a pdf file containing a
>text annotation then when I subsequently use acrobat 5 to
>optimize the pdf file it modifies my text annotation in a way
>that I do not want. In fact it includes a "popup" annotation
>whose dictionary has an M entry that I don't want.
>I can circumvent this by including a popup annotation, but
>it is a bit painful. I have to say something like this:
>   \pdfannot width 12 cm height 2 cm depth 10 pt
>   {/Subtype /Popup
>   /T (Algebra 1)
>   /Open false
>   /C [0 1 1]
>   /Contents
>   (Lectures given at the University of Sydney for the course
>   Math3902.)}
>   \pdfannot height 2 cm depth 10 pt
>   {/Subtype /Text
>   /C [0 1 1]
>   /Popup \the\pdflastannot\space 0 R}%
>i.e. the T and Contents entries go into the popup
>instead of the text annotation itself.
>What I would have liked to do is have the T and Contents
>entries in the dictionary of the text annotation and
>put a Parent key in the dictionary of the popup referring
>back to the text annotation. However, this means having
>entries in the dictionaries of each text annotation
>and the popup annotation referring to the other.
>I can't figure out a way to do this with pdftex.
>It seems to me that I need to be able to tell pdftex to
>choose some number that has not yet been used
>for an object, create an indirect reference to a
>yet-to-be-constructed object with that number, and then
>later make an object with that number.
>Can this be done?

sure, just put the object in a box, something like:

\newbox \yourbox

\setbox \yourbox {\immediate\pdfobj{...}\xdef\nicepointer{\the\pdflastobj}}

\pdfblablabla{... \nicepointer ...} \box yourbox

Am i right that you use the second annot to position the real one? (kind of 
hackery since it may introduce an unwanted node)

What exactly is wrong with the optimization that acrobat applies? I tested 
it on my own implementation of notes (comments) and it came out as 
expected. (just curious)


                                   Hans Hagen | PRAGMA ADE | pragma at wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
                                   fall-back web server: 

More information about the pdftex mailing list