[pdftex] pdfsavepos

Hans Hagen pragma at wxs.nl
Tue Apr 15 19:03:35 CEST 2003

At 16:55 15/04/2003 +0200, Andre Wobst wrote:

>Fine. But I want to be able to insert some position markers in the
>string (here it is "Hello, world!"). I want to be able to print out
>the position of that markers. Unfortunately I can't use specials in
>the dvi output, because after the shipout the dvi output for that page
>isn't available immediately. There seems to be some dvi write caching
>in TeX (at least, that's what I observed). On the other hand, by
>pdfsavepos, I have immediately access to the positions once the
>shipout is performed. As I understood the topic, with builtin TeX
>facilities I can't access any information about relative positions
>within a box even when the box is completely ready before the shipout
>as you can see in my example above.

due to tex's dynamic character you only have access to the position at 
shipout time (or in a second pass); unfortunately you cannot so a fake 
shipout without losing that info, well, you could do something:

open temp file
shipout and save positions
read them file

but as said, there is still this shipped out page (ok, there are means to 
discard it in a second run, or to put it 10 meters in the margin and 
correct the positions for that); even worse, there is no nice way (only 
dirty ones) to hide writes embedded in such a page so you end up with 
multipls refs and toc entries and alike (for that purpose we need a switch 
to enable/disable writes, but so far no-one was willing to implement that 
for me; we also need that kind of control for page imposition and content 
reuse -)

(since this is not that much related to pdftex, we can discuss this of list)

                                   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
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf

More information about the pdftex mailing list