<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1251">
<META content="MSHTML 5.50.4807.2300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Tahoma>John, thank you for your reply.<BR><BR>I am trying
to create a PDF document (DVI is not a requirement) that would<BR>show the
total number of pages on each page (e.g. PAGE X OF Y), and do it in<BR>one
front-to-back linear pdfTeX pass! I believe it can be done in PDF by<BR>using
"forward object references" (I also did not think it was possible<BR>until a
colleague of mine suggested this interesting method). For example,<BR>the output
doc can look as follows:<BR><BR>page 1: PAGE 1 OF <reference to 1000 0
R><BR>page 2: PAGE 2 OF <reference to 1000 0 R><BR>....<BR>page 100:
PAGE 100 OF <reference to 1000 0 R><BR>1000 0 obj
<<...100...>><BR><BR>As per my understanding pdfTeX allows you to
output an object first, and<BR>only then to get hold of its object number
(reference). What I would like to<BR>do is, for example:<BR>-- allocate an
object reference first \myobjref<BR>-- use this reference on every page:
\pdfrefobj\myobjref<BR>-- specify the object reference to \pdfobj when I output
the my object in<BR>the end, e.g.: \pdfobj objref\myobjref ...<BR><BR>Is there a
way to achieve this in pdfTeX?<BR><BR>Thank you,<BR>Igor.<BR><BR>----- Original
Message -----<BR>From: "John Culleton" <<A
href="mailto:john@wexfordpress.com">john@wexfordpress.com</A>><BR>To: "Igor
Khomyakov" <<A
href="mailto:igorkh@optonline.net">igorkh@optonline.net</A>>; <<A
href="mailto:pdftex@tug.org">pdftex@tug.org</A>><BR>Sent: Thursday, March 06,
2003 9:19 AM<BR>Subject: Re: [pdftex] Forward looking object
references<BR><BR><BR>> On Tuesday 04 March 2003 11:38 pm, Igor Khomyakov
wrote:<BR>> > Hi,<BR>> ><BR>> > I have a question on
\pdfobj\pdfrefobj\pdflastobj. Is there any way you<BR>can<BR>> > get the
obj reference before you output the object, i.e. can you do<BR>> >
"forward" looking obj references with pdftex?<BR>> ><BR>> > Thank
you,<BR>> ><BR>> > Igor Khomyakov<BR>> > E-mail: <A
href="mailto:igorkh@optonline.net">igorkh@optonline.net</A><BR>><BR>> I
think you mean use the object before it is defined. This would
probably<BR>mean<BR>> a two-pass evaluation of the source file. While
two passes are necessary<BR>for<BR>> e.g., TOC and index I don't see the
necessity of using objects first,<BR>> defining them later. TeX is
essentially a linear process, front to back.<BR>><BR>> IMHO of
course.<BR>><BR>> John Culleton<BR>>
_______________________________________________<BR>> pdftex mailing
list<BR>> <A href="mailto:pdftex@tug.org">pdftex@tug.org</A><BR>> <A
href="http://tug.org/mailman/listinfo/pdftex">http://tug.org/mailman/listinfo/pdftex</A><BR>><BR></FONT></DIV>
<DIV><FONT face=Tahoma></FONT> </DIV></BODY></HTML>