ps2pdf Unrecoverable error

dearN picture dearN · Oct 25, 2012 · Viewed 7.8k times · Source

I have an unrecoverable error, exit code 1 showing up when I try to convert my .ps files to pdf. It worked just about a half hour ago and now it wont. The file is there!

Error: /undefinedfilename in (10132012a.ps)
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push
Dictionary stack:
   --dict:1161/1684(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 9.04: Unrecoverable error, exit code 1

Here is my command:

ps2pdf 10132012a.ps 10132012b.pdf

The ps file was created using latex.

I am running Ubuntu 11.10.

Answer

chrisl picture chrisl · Oct 26, 2012

You might try running Ghostscript directly, rather than using the script:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -o 10132012b.pdf 10132012a.ps

or even:

gs -sDEVICE=pdfwrite -o 10132012b.pdf - < 10132012a.ps

The "convenience" scripts (ps2pdf, pdf2ps, etc) use options which might get in the way (although they really shouldn't).