I am preparing a Document to be downloadable from the web. The original file has some really high resolution images included (png result images, some >1200dpi), so the original file is 23 MB. Using a Standard technique in Mac OS that converted the images to have 300dpi reduced the size to beautiful 4,5 MB, but the fromt matter isn't numbered with i,ii,... anymore. So i would like to get a similar result already with XeTeX (i.e. the xdvipdfmx driver). Is there an option to specify that?

  • 1
    Use ImageMagick (or similar tools) to downscale the images before including them? – Khaled Hosny Nov 5 '13 at 21:57
  • 1
    I would like to keep the images as they are to still be able to produce the high quality version. Changing the images would mean to create a complete second version. – Ronny Nov 5 '13 at 23:06
  • 2
    I’d keep two version of the files in different directories and use \graphicspath depending on what version I want (and probably with a Makefile to automate everything), that gives me the ultimate control and avoids post-processing that might silently change other things. – Khaled Hosny Nov 5 '13 at 23:56
  • I might keep that in mind for a next project. this one is basically finished, – Ronny Nov 6 '13 at 5:32

I don't think there's a way to do this through xdvipdfmx, but it's easy to post-process the entire PDF file to downsample the images:

$ gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/prepress -dNOPAUSE
     -dQUIET -dBATCH -sOutputFile=<your-smaller-file>.pdf <yourfile>.pdf

Alternatively you can use the option dPDFSETTINGS=/printer, which will produce a slightly smaller file, but generate a (harmless) warning relating to ICC profiles.

Ghostscript is a hugely powerful program, with more options than any mortal can know. Many of the options implement parts of the Adobe PDF distiller options. The downsampling in this example is given by the -dPDFSETTINGS=printer which implements one of the basic Distiller configurations:


Presets the "distiller parameters" to one of four predefined settings:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
  • /default selects output intended to be useful across a wide variety of uses, possibly at the expense of a larger output file.

The full list of individual options and their values for each configuration is documented in the ps2pdf documentation. The Adobe Parameters themselves are documented here.

Here are the relevant individual options that pertain to downsampling images and their values for the different configurations:

Parameter name         default screen ebook printer prepress 
ColorImageResolution      72     72    150    300     300 
DownsampleColorImages   false   true   true  false   false
DownsampleGrayImages    false   true   true  false   false
DownsampleMonoImages    false   true   true  false   false 
  • That worked like a charm, 4,5 MB ans still having all metadata and the correct page numbers. Though its not the way i thought of (i.e. options for xdvipdfmxi think that's what i was serching for. Can you extend your answer and explain the options, for example where the 300dpi or the quality in general is included? – Ronny Nov 5 '13 at 23:13
  • Nice! That was exactely the kind of explanation i thought of in order to understand the options you used. – Ronny Nov 6 '13 at 6:13
  • I'll second that your solution worked like a charm! I took my file from 14.9MB down to 3.2MB with the command you posted, and I probably could get it smaller still by making the artwork B&W and playing with the DPI settings. – cjm Oct 2 '16 at 1:57
  • As a follow-up for experimentation, what are the differences between the printer and prepress parameters? It looks like they're identical in the table you provided. – cjm Oct 2 '16 at 1:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.