[pdftex] redundant objects with includegraphics

Heiko Oberdiek oberdiek at ruf.uni-freiburg.de
Fri May 4 16:20:04 CEST 2001


At 10:18 04.05.2001 +0200, Otfried Cheong wrote:
>
>[...] the patch I've
>put up does not define a new primitive, and does not require any
>changes in macro packages or user's code.  It simply fixes the problem
>in pdftex.

Good.

> > * This week I have learned about \pdflastximagepages. But is there
> >   a more elegant way than
> >     \begingroup
> >       \sbox0{\includegraphics{foo.pdf}}%
> >       \xdef\foopages{\the\pdflastximagepages}%
> >     \endgroup
> >     Result: foo.pdf has \foopages\ page(s).
> >     ...
> >     \includepdf[pages=1-\foopages]{foo.pdf}
>
>I would just use the \pdximage primitive directly (not that it's a big
>improvement):
>
>\xpdfimage{foo.pdf}\def\foopages{\the\pdflastximagepages}%

With \includegraphics, the referenced number will be reused,
if the first page is embeded later. Or only other pages
are used, or the pdf file will not embedded at all. So the
question is, what is the best strategy for getting the
number of pages?

>Or, even better, ask Andreas to use the primitive in "pdfpages"
>itself, so that the above code becomes:
>
>\includepdf[pages=1-]{foo.pdf} :-)

Yes :-) (But somehow Andreas has to get number of pages--therefore
        the question above.)

Yours sincerely
  Heiko <oberdiek at ruf.uni-freiburg.de>



More information about the pdftex mailing list