Error converting PDF to PostScript with GhostScript, access denied Unable to open _.at command line file

I installed ghostscript and updated the corresponding path variables ... however, I get an error when trying to execute this command:

 C:\PROGRA~1\gs\gs8.64\lib>pdf2ps mydocument.pdf mydocument.ps Access is denied. Unable to open command line file _.at 

Is this the right team? Am I missing some settings or path settings? Otherwise, is there a reasonable way to do this conversion?

+7
pdf postscript ghostscript file-conversion
source share
6 answers

Access denied, suggesting something to be done with access to paths, etc. I would suggest double-checking the permissions on the folder (although I'm sure you did). Alternatively, you can try running gswin32c.exe instead of pdf2ps to make sure that you are still getting the error, you can get something more specific.

 gswin32c.exe ^ -dNOPAUSE ^ -dBATCH ^ -sDEVICE=pswrite ^ -sOutputFile=mydocument.ps ^ mydocument.pdf 
+11
source share

Using pdf2ps launches a batch file that is really called pdf2ps.bat or pdf2ps.cmd . You can easily find and understand its "source code". If you do this, you will see that he is trying to write some of his command line options to a temporary file named _.at to overcome the 128 character limit for the DOS / cmd command line length that exists on some Win / DOS platforms.

Since you are calling pdf2ps from the% programs% directory where Ghostscript is installed, you don't seem to be using an account that is allowed to write things there. :-)

+8
source share

With the Ghostscript version gs9.10, the pswrite method did not work for me, instead I tried using ps2write and it worked for me, so the command worked for me, as shown below:

 gswin32c.exe ^ -dNOPAUSE ^ -dBATCH ^ -sDEVICE=ps2write ^ -sOutputFile=mydocument.ps ^ mydocument.pdf 

and if this thing doesn’t even work, then you can do it: try to get help by typing gswin32c.exe -h and then it will display all available devices, as shown below:

 Default output device: display Available devices: bbox bit bitcmyk bitrgb bj10e bj200 bjc600 bjc800 bmp16 bmp16m bmp256 bmp32b bmpgray bmpmono bmpsep1 bmpsep8 cdeskjet cdj550 cdjcolor cdjmono cp50 declj250 deskjet devicen display djet500 djet500c eps9high eps9mid epson epsonc epswrite ibmpro ijs inkcov jetp3852 jpeg jpegcmyk jpeggray laserjet lbp8 lj250 ljet2p ljet3 ljet3d ljet4 ljet4d ljetplus m8510 mswindll mswinpr2 necp6 nullpage pamcmyk32 pamcmyk4 pbm pbmraw pcx16 pcx24b pcx256 pcxcmyk pcxgray pcxmono pdfwrite pgm pgmraw pgnm pgnmraw pj pjxl pjxl300 pkmraw plan planc plang plank planm plib plibc plibg plibk plibm png16 png16m png256 pngalpha pnggray pngmono pngmonod pnm pnmcmyk pnmraw ppm ppmraw **ps2write** psdcmyk psdrgb pxlcolor pxlmono r4081 spotcmyk st800 stcolor svg t4693d2 t4693d4 t4693d8 tek4696 tiff12nc tiff24nc tiff32nc tiff48nc tiff64nc tiffcrle tiffg3 tiffg32d tiffg4 tiffgray tifflzw tiffpack tiffscaled tiffscaled24 tiffscaled32 tiffscaled4 tiffscaled8 tiffsep tiffsep1 txtwrite uniprint xpswrite Search path: C:\Program Files (x86)\gs\gs9.10\bin ; C:\Program Files (x86)\gs\gs9.10\lib ; C:\Program Files (x86)\gs\gs9.10\fonts ; %rom%Resource/Init/ ; %rom%lib/ ; c:/gs/gs9.10/Resource/Init ; c:/gs/gs9.10/lib ; c:/gs/gs9.10/Resource/Font ; c:/gs/fonts Initialization files are compiled into the executable. 

As you can see for convenience only, I placed an asterisk (*) around ps2write

+4
source share

If you want to use the gs executable, you need to change the permissions. At the command prompt, navigate to the folder where the gs executable is located, and then use chmod 755 gs.

+1
source share

use gimp to open the pdf file.

file -> export -> postscript.

+1
source share

What you do is that you do not write the command line in the right place, first you need to find out the exe installation from ghostscript, which is located by default in

  • c: \ Program Files (x86) \ gs \ gs9.20 (your ghostscript version) \ Bin \ gswin32c.exe

there are two exe

  • 1- gswin32.exe
  • 2- gswin32c.exe

you need to use the second one because its execution is compiled on cmd not in gs cmd ok now you need to write a command, for example

  ...bin\gswin32c.exe -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=mydocument.ps mydocument.pdf 

note, check the file path correctly and one more thing the file path "D: \ HtmlToPdf \ document.ps" should be written as "D: /htmltopdf/document.ps" yes, exactly replace the backslash with a slash only in the file path and the command line is also case sensitive, so be careful with cases

0
source share

All Articles