[pdftex] Forward looking object references
Hans Hagen
pragma at wxs.nl
Fri Mar 14 08:48:27 CET 2003
At 01:10 AM 3/14/2003 -0500, Igor Khomyakov wrote:
>I am trying to create a PDF document (DVI is not a requirement) that would
>show the total number of pages on each page (e.g. PAGE X OF Y), and do it in
>one front-to-back linear pdfTeX pass! I believe it can be done in PDF by
>using "forward object references" (I also did not think it was possible
>until a colleague of mine suggested this interesting method). For example,
>the output doc can look as follows:
>
>page 1: PAGE 1 OF <reference to 1000 0 R>
>page 2: PAGE 2 OF <reference to 1000 0 R>
>....
>page 100: PAGE 100 OF <reference to 1000 0 R>
>1000 0 obj <<...100...>>
>
>As per my understanding pdfTeX allows you to output an object first, and
>only then you can get its object number (reference). What I would like to
>do is, for example:
>-- allocate an object reference first \myobjref
>-- use this reference on every page: \pdfrefobj\myobjref
>-- specify the object reference to \pdfobj when I output the my object in
>the end, e.g.: \pdfobj objref\myobjref ...
>
>Is there a way to achieve this in pdfTeX?
for something "PAGE n OF m" as typeset text you really need a second pass
or know the number of pages in advance, unless the 'm' is a widget and
displayed as such (in which case you need a lot more object refs and get
ugly results)
if your purpose is to have forward refs in hyperlinks, you can use named
destinations like "page n"
Hans
-------------------------------------------------------------------------
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