[pdftex] redundant objects with includegraphics

Otfried Cheong otfried at cs.uu.nl
Wed May 2 15:38:37 CEST 2001


 > unless I am going soft in the head, or someone has broken it,
 > pdftex.def for includegraphics does keep just copy of an included
 > graphic, and subsequent requests just reference that copy. I clearly
 > recall doing the work several years ago

It's me who's going soft in the head.  I had tested with \pdfximage
and jumped to conclusions about \includegraphics.

Since 'pdftex.def' already caches this information, it shouldn't be so
hard to add support for my original proposal.  Let's say we add a
primitive 

   \pdfembedpdf [ pages <first> <last> ] {pdf-filename}

\pdflastximage then returns the reference for the <first> page,
\pdflastximagepages returns the number of pages included (not the
number of pages in the PDF file).  You could use any page in the range
by using \pdfrefximage <n>, where <n> is in the range \pdflastximage
.. \pdflastximage + \pdflastximagepages - 1.

Would it be easy to support this in 'pdftex.def'?  Such as this:

   \includegraphics[page=1,cache=3]{a.pdf}
   \includegraphics[page=2]{a.pdf}
   \includegraphics[page=3]{a.pdf}

The 'cache' option asks for the embedding of three pages, starting
with page 1.

Or could you suggest a different form of the new primitive?

Otfried





More information about the pdftex mailing list