acman123
acman123

Reputation: 269

ghostscript gives error when converting pdf to ps

I cannot convert pdf to ps or ps to pdf. an example is given below. Please someone help me.

GS>pdf2ps f.pdf
Error: /undefined in pdf2ps
Operand stack:

Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- %loop_continue --nostringval-- --nostringval-- false 1 %stopped_push .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval--
Dictionary stack:
--dict:1199/1684(ro)(G)-- --dict:0/20(G)-- --dict:78/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
Current file position is 7

Upvotes: 0

Views: 845

Answers (1)

KenS
KenS

Reputation: 31141

pdf2ps is a shell script, not a PostScript program. You appear to have started the interpreter and reached the interactive prompt, which probably means you started Ghostscript without any arguments on the command line.

Either:

  • Use the pdf2ps script from the shell, it will launch Ghostscript with default arguments to create a PostScript file from the specified argument
  • Use Ghostscript with appropriate command line arguments (eg -sDEVICE=ps2write) to do the conversion yourself.

If you choose the latter route you will have to understand at least the basics of the Ghostscript command line options, but it will give you better control.

Upvotes: 1

Related Questions