[Tex/LaTex] Ghostscript 8.57: Unrecoverable error, exit code 1


I do have a problem in producing a pdf (latex -> dvips -> ps2pdf) with an error saying

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

Best Answer

Your dvips is configured to send the output to lpr (printing) instead of generating a PostScript file. From the output, given in your comment:

This is dvips(k) 5.95a [...] ' TeX output 2013.06.15:1522' -> |lpr [...]

The output PostScript file can be specified directly:

dvips -o A.ps A.dvi

generates a PostScript file A.ps that can then be processed by ps2pdf:

ps2pdf A.ps

dvips can be reconfigured via the configuration file config.ps. It can be found by kpsewhich:

kpsewhich config.ps

For example it returns .../texmf-dist/dvips/config/config.ps. Then locate the line:

o |lpr

that pipes the output to the printing system. Add a percent before to disable this setting:

%o |lpr

Then the default output is a PostScript file.