Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm about to submit a Latex template to a colleague organizing a conference but one of my tests fails. This is the one on Windows 7 and Miktex 2.9 with the ps2pdf executable to create the final pdf file. I'm using Ghostscript 9.05 and I just reinstalled Miktex 2.9 to make sure but invariably get the following error message:

Command Line:   "C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\ps2pdf.exe" "File.ps"
Startup Folder: C:\Users\User\Desktop\conference

Error: /undefinedfilename in (File.ps)
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--     2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push
Dictionary stack:
   --dict:1169/1684(ro)(G)--   --dict:0/20(G)--   --dict:77/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
MiKTeX GPL Ghostscript 9.05: Unrecoverable error, exit code 1`

Everything else works fine. I can open the File.ps file in Ghostview and convert it to a pdf. The following command line works too: epstopdf File.ps (even though it should be avoided). Equivalent Adobe tools do work as well. I still want to recommend the ps2pdf command because this is the one by default. It used to work in the past but fails now.

I do not know what is wrong here with this ps2pdf command and I am interested in current Windows/Miktex 2.9 users' experience. It looks to me that everything is correctly set-up though.

Edit: there is something wrong is my computer but I cannot figure out what.

share|improve this question

1 Answer

there seems to be a problem with the security setting of GhostScript, it doesn't allow to open and run external files. Try

ps2pdf -dNoSafer <file>

For dvips exists also a security option:

-R[0|1|2]  Run securely.  
  -R2 disables both shell command execution in \special'{} (via 
      backticks ` ) and config  files  (via  the  E option),  and  
      opening of any absolute filenames.  
  -R1 , the default, forbids shell escapes but allows absolute filenames. 
  -R0 allows both.  The config file option is z
share|improve this answer
Thanks but it does not help. Now I know that there is a problem on my computer (because the same command lines work for a colleague with a very similar installation). Should Ghostscript and Ghostview be installed on the computer to run ps2pdf? – pluton Oct 1 '12 at 5:39
ps2pdf is only a wrapper for calling GhostScript. GhostViw is not really needed, it is onla another viewer for ps/pdf files – Herbert Oct 1 '12 at 6:36
yes, but I discovered that Miktex 2.9 comes with its own gs9.05. Still; it does not work here. – pluton Oct 1 '12 at 13:07
and how did you call dvips. It has a security option, too. – Herbert Oct 1 '12 at 13:16
I just used dvips File: what is the security option? – pluton Oct 1 '12 at 13:18
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.