[pdftex] pdf objects with references to each other?
rhowlett at mail.usyd.edu.au
Sun Mar 31 16:33:48 CEST 2002
Ross Moore wrote:
> Hi Bob,
> > 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
> You cannot do this.
I was wondering whether to ask for new primitives so that
it could be done. But Heiko's solution works.
> > 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.
> What you *can* do is to first make what you said was the
> "yet to be constructed" object.
> Then use \lastobjxref (is that the right name?) primitive
> to get its number, for use in other <object>s.
> When your document source needs to be ordered so that the
> referer comes before the referee, then use the .aux file idea.
> Dump the referer coding into a file, to be read back later,
> when the reference number is known. Place the PDF objects into
> the file then, or ...
> ... better still, upon the 2nd processing of the file
> having read the references numbers collected on the previous run.
> You should be able to reduce the write/read part to just the reference
> numbers. Then you'll also want to check, at the end of the job, that
> those numbers didn't change between this run and the previous.
> Many packages have coding to do this, as well as LaTeX itself, of course.
> > Can this be done?
Being by instinct a user of plain rather than latex I always look
for ways of doing things that don't use a two-pass approach.
But may have to give up. I've already got a problem with bookmarks:
when creating a bookmark one needs to know how many descendants it
is going to have, and I won't know that until I get to the end
of the section ...
So I'll probably have a go at what you suggest.
More information about the pdftex