ps2pdf, miktex, windows and a conference

If you ever submit a paper for final publication and you use windows for the process, there are good chances you will run into this.

To make it google-worthy, I'll add some keywords:-

miktex ps2pdf windows ghostscript error embed embedded fonts flatencode vector fonts

Most conferences want your fonts to be embdedded in the pdf document, so that your submission looks the same for everyone on the planet. However, you use windows and don't even know what font embedding means, and how to enable it. Moreover, you notice annoying compression artifacts in your images when you compile, and you know that stinks. So you visit your favorite conference website for PDF quality guidelines, and you download the following ps2pdf options:-

{taken from SIGGRAPH}

For ghostscript 8.x (which is what we have because we live in the 21st century),

ps2pdf –dPDFSETTINGS=/prepress -dCompatibilityLevel=1.3 -dAutoFilterColorImages=false -dAutoFilterGrayImages=false -dColorImageFilter=/FlateEncode -dGrayImageFilter=/FlateEncode -dMonoImageFilter=/FlateEncode -dDownsampleColorImages=false -dDownsampleGrayImages=false paper.ps paper.pdf

Enthusiastically, you go ahead insert it into your script/latexmkrc/winEdt configuration, and you hope it works.

You build your paper.

And, you are faced with one or more of the following errors:-

rangecheck in .putdeviceprops
undefined in get
undefined filename
unknown X

You have no idea what they mean. No one does, they painstakingly vague. You google and you google to find answers. You get trapped in a sea of usenet threads from 1970. You battle each and every one of those messages before realizing that your problem is most likely much dumber than recompiling ghostscript for your OS.

Then, if you're lucky, you land on this page. Really, I've tried hard to make sure you do. Here are the answers to your questions:-

1. These nasty errors

To start throwing these errors away, first replace every '=' in the ps2pdf commandline with a '#'. The reason behind this miracle is the following:- ps2pdf, as shipped with MikTeX, is a windows batch file. Thus, commandline arguments cannot contain '=', which is why most errors occur. I can see that shocked look on your face. You'd think this would have been documented somewhere, but no. One HAS to get his hands dirty to get this done.

2. Embedding fonts

The option –dPDFSETTINGS#/prepress ensures that fonts are embedded in ghostscript 8.x

For ghostscript 7.x, use options -dSubsetFonts#true -dEmbedAllFonts#true

This is very simple once you get rid of the bugs from hell.

3. All the other options above make your images crisp and professional.

Here's my latexmkrc for reference. It worked with ghostscript 8.54 and SIGGRAPH:

$dvips = "dvips -q -e 0 -P pdf -G0 -t letter";
$ps2pdf = "ps2pdf -dPDFSETTINGS#/prepress -sPAPERSIZE#letter -dCompatibilityLevel#1.3 -dAutoFilterColorImages#false -dAutoFilterGrayImages#false -dColorImageFilter#/FlateEncode -dGrayImageFilter#/FlateEncode -dMonoImageFilter#/FlateEncode -dDownSampleColorImages#false -dDownSampleGrayImages#false ";

No comments: