[pdftex] Too many files open

Heiko Oberdiek oberdiek at uni-freiburg.de
Tue Oct 6 08:59:27 CEST 2009

On Tue, Oct 06, 2009 at 08:11:08AM +0200, Ulrich Dirr wrote:

> I'm recently compiling a 1100 pages document containing about 700 high
> resolution images. Everything compiles fine. But strangely when trying to
> send to the editor a small file for proofing -- with
> \RequirePackage[pdftex,draft]{graphicx} put in my style file -- I got
> shortly before the end a "too many files open" error message, and acrobat or
> pdf-xchange can't open the file produced.
> I searched the archives and found a reply by Martin Schröder proposing to
> put in the preamble
>    \let\mypdfximage\pdfximage
>    \def\pdfximage{\immediate\mypdfximage}.
> This worked as far as the document now compiles without an error. But
> unfortunately the document size -- despite displaying only frames for images
> -- doesn't decrease at all!

\immediate means, the image is added to the pdf file at once.
Hoewever if it is not used, the occupied object is marked free
at the end. You can use pdftk to get rid of them, for example:
  pdftk large.pdf cat output small.pdf

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

More information about the pdftex mailing list