Ghostscript is a well known interpreter for the PostScript language and for PDF. This package implements a interface to the Ghostscript C-API using ctypes.Both a low-level and a pythonic, high-level interface are provided.
Active1 year, 5 months ago
Following
I used the following command to convert a postscript file to pdf:
but I got an error (I got the same error with ps2pdf): Windows 7 compatibility mode.
GPL Ghostscript 9.06 (2012-08-08) Copyright (C) 2012 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Error: /undefinedfilename in (mu-calc.ps) Operand stack:
Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval--
--nostringval-- 2 %stopped_push --nostringval-- --nostringval--
--nostringval-- false 1 %stopped_push Dictionary stack: --dict:1167/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)-- Current allocation mode is local Last OS error: Permission denied GPL Ghostscript 9.06: Unrecoverable error, exit code 1
--nostringval-- 2 %stopped_push --nostringval-- --nostringval--
--nostringval-- false 1 %stopped_push Dictionary stack: --dict:1167/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)-- Current allocation mode is local Last OS error: Permission denied GPL Ghostscript 9.06: Unrecoverable error, exit code 1
I tried various other options at
but I always got the same error.
How can I make it work?
Community♦
GergelyGergely2,47822 gold badges1414 silver badges2424 bronze badges
2 Answers
It turned out that the file
mu-calc.ps
had no access rights on the Linux machine.The error message
/undefinedfilename
was not precise, but this is because of the age of the postscript language, as the comment above explains. At that time, filesystems did not have file permissions.
GergelyGergely2,47822 gold badges1414 silver badges2424 bronze badges
There is permission problem. Open the command prompt with administrator rights.
Khizer ButKhizer But
Not the answer you're looking for? Browse other questions tagged pdfghostscriptpostscript or ask your own question.
Active1 year, 11 months ago
I installed
ghostscript
and updated the appropriate path variables
.. however, I'm getting an error when I try to execute this command:Is this the right command? Did I miss some configuration or path setting? Otherwise, is there a sane method of doing this conversion?
Rahul Gupta6,15444 gold badges4040 silver badges5353 bronze badges
Joel MartinezJoel Martinez33.6k2424 gold badges117117 silver badges177177 bronze badges
6 Answers
Access is denied suggest something to do with access to paths etc. I'd suggest rechecking the folder permission (although I'm sure you've done that). Also, you might want to try running the
Rahul Guptagswin32c.exe
instead of the pdf2ps
to see if you still get the error, you might get something a little more specific.6,15444 gold badges4040 silver badges5353 bronze badges
Douglas AndersonDouglas Anderson3,49577 gold badges3535 silver badges4444 bronze badges
Using
pdf2ps
runs a batch file, really named pdf2ps.bat
or pdf2ps.cmd
. You can easily look up and understand its 'source code'. If you do, you'll see it tries to write some of its commandline options into a temporary file named _.at
, in order to overcome the 128 character limit for DOS/cmd commandline length that exist on some Win/DOS platforms.Since you are invoking
Kurt PfeifleKurt Pfeiflepdf2ps
from the %programs% directory where Ghostscript is installed, you don't seem to be using an account that is permitted to write stuff in there. :-)68.3k1515 gold badges186186 silver badges285285 bronze badges
With Ghostscript version gs9.10 the method pswrite didn't worked for me instead I tried using ps2write instead, and it worked for me, so the command worked for me is as below:
and if this thing doesn't even works, then one can do this :try getting help by typing
gswin32c.exe -h
and then it will list all the available devices as shown below:As one can see only for the convenience only I have placed star(*) around the ps2write
Rahul GuptaRahul Gupta6,15444 gold badges4040 silver badges5353 bronze badges
use gimp open PDF file.
file -> export -> postscript.
kangearkangear1,57622 gold badges1717 silver badges3333 bronze badges
If you want to use the gs executable you have to change the permissions.In the command prompt go to the location where gs executable is located and then use chmod 755 gs.
Ankit JainAnkit Jain
1,50311 gold badge1414 silver badges2424 bronze badges
What you are doing is you are not writing command line at right place first you have to find out the instillation exe of ghostscript which is by default located at
- c:Program Files(x86)gsgs9.20(your ghostscriptversion)bingswin32c.exe
there are two exe
- 1- gswin32.exe
- 2- gswin32c.exe
you have to use the second one because it execuit commmands at cmd not in gs cmd ok now what you have to do is write command like
note please check the file path correctly and one more thing file path like 'D:htmltopdfdocument.ps'should be write as 'D:/htmltopdf/document.ps'yes exactly replace backward slash with foreword slash only in file pathand the command line is case sensitive also so be carefull with cases
Praveen_KumarPraveen_Kumar