Search code examples
ghostscriptpostscript

Strange error on ghostscript conversion ps to pdf


I am using linux (ubuntu 9.26) version of ghostscript. When I try to convert the postscript file into pdf using the following:

$ gs -dNOPAUSE -dBATCH -sOutputFile=test.pdf -sDEVICE=pdfwrite -c . setpdfwrite -f d00040-001.ps

The output I get is the following:

GPL Ghostscript 9.26 (2018-11-20)
Copyright (C) 2018 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Error: /undefined in .
Operand stack:

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

Where can I look and how can I debug the above issue?

Solution

  • Leave out the "-c . setpdfwrite -f" from your command line.