3

Possible Duplicate:
Multiple inclusion of the same image gives huge PS file

I recently started to include a graphic in the header of a long PDF document and the file size has grown significantly. The document is over 2000 pages and before adding the graphic the final PDF was around 10MB. Adding our company logo, which is in EPS format and around 274KB in size, the final PDF has grown to 45MB. Ouch!

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[L]{\rule[-2ex]{0pt}{2ex} \includegraphics[height=60pt]{C:/Users/chris/Documents/scm/images/LOGO_CMYK.eps}}
\fancyhead[C]{\textsc{\large{Department}}}
\fancyhead[R]{\bfseries {\Huge Title}}

I suspect each page has its own copy of the graphic. The intermediate postscript file produced by dvips is now 577MB, from about 45MB. (274KB * 2000 pages =~ 550MB)

Is there a better way to include this graphic please? It's against company policy to modify the company logo so I must work with the 274KB EPS file. Is there a way to include the graphic once, and then reference from each page header?

I'm using latexmk and producing PDFs via PS (latexmk -pdfps), so latex + dvips + ps2pdf (via MiKTeX 2.9).

Thanks, Chris

  • 6
    See Heiko Answer here: tex.stackexchange.com/questions/54747/…. (The easiest is to use pdflatex which reuses graphics by default). – Ulrike Fischer Nov 15 '12 at 14:25
  • You can try to postprocess the PDF with pdfsizeopt. – olpa Nov 16 '12 at 9:46
  • @UlrikeFischer Thanks for the tip. For now, I've switched to using pdflatex and my final PDF file size is now 12MB. I had a quick read of section 16.1 from that document, and reading across with my EPS image couldn't work out how to split, so gave up. Thanks again. – chris Nov 19 '12 at 10:36
  • OK, so it sounds like a dupe: I'll mark as such, as for reopening if you disagree. – Joseph Wright Nov 19 '12 at 13:04