[pdftex] redundant objects with includegraphics

Otfried Cheong otfried at cs.uu.nl
Fri May 4 11:18:00 CEST 2001


 > >I cannot come up with a reason why one would
 > >want to embed the same file multiple times
 > 
 > * logos
 > * special characters/symbols, embeded as graphics.
 > [...]

These are all examples for wanting to *use* an embedded image several
times, not for wanting to embed it several times.

 > No, I think it is not a good idea. A typical user would
 > not see a reason to use the option "cache". A lot of
 > explanation has to be written to explain this an user,
 > but users do not read documentation.

Exactly.  In case it wasn't clear from my description, 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.

 > * 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}%
Result: foo.pdf has \foopages\ page(s).
...
\includepdf[pages=1-\foopages]{foo.pdf}

Or, even better, ask Andreas to use the primitive in "pdfpages"
itself, so that the above code becomes:

\includepdf[pages=1-]{foo.pdf} :-)

Otfried





More information about the pdftex mailing list