I'm currently working on a LaTeX document with some photos in it. As I'm using the PowerDot class, which is incompatible with pdflatex, I need to convert all my images to EPS and use ps2pdf to get my final PDF document. On the first attempt, I used the command
ps2pdf file.ps file.pdf
and it worked, except that my photos came out all muddy, a result of over compression. So, I added the option to turn off compression,
ps2pdf -dEncodeColorImages=false file.ps file.pdf
and end up with the wonderfully obtuse error message
Error: /undefinedfilename in (false)
Operand stack:
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push
Dictionary stack:
--dict:1122/1686(ro)(G)-- --dict:0/20(G)-- --dict:70/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
MiKTeX GPL Ghostscript 8.54: Unrecoverable error, exit code 1
Ick.
It turns out that ps2pdf on Windows is a batch file, and batch files do not accept = in an argument. I had no idea that this was the case, but so it is. The solution, which is annoyingly absent in the documentation, is to replace = with #. Thus, the command on windows should be,
ps2pdf -dEncodeColorImages#false file.ps file.pdf
Like that, it works. And, I get my beautiful uncompressed photos in my document.
I had the same problem, thank you!
ReplyDeleteMe too! Thanks!
ReplyDeleteAnd me! Thanks a million!
ReplyDeleteThanks
ReplyDeleteThanks a lot!!! I finally find the solution of my problem!!!!!
ReplyDeleteit is in the docs, at http://pages.cs.wisc.edu/~ghost/doc/cvs/Use.htm#MS_Windows
ReplyDeleteHowever I found the solution here, and only then remembered seeing something about this, years ago, and dug it up. So thanks for posting :)
This comment has been removed by the author.
ReplyDeleteYup, helpfully the documentation on MS Windows only seems to be in new versions of Ghostscript (8.6+) so it seems in this case, Google Search is the wrong thing to do!
ReplyDeleteoh man I spent 4 hours with this...
ReplyDeleteThanks, very helpful! :)
ReplyDeleteThanks so much for posting this. I was banging my head against the wall about this one.
ReplyDelete