Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7872425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:11:50+00:00 2026-06-03T02:11:50+00:00

I have the latest GPL Ghostscript v9.05 and I am running it on Win

  • 0

I have the latest GPL Ghostscript v9.05 and I am running it on Win 32 bit systems. On my XP machine, both commands

ps2pdf -v -

and

rungs -v (used internally by TeXLive)

report of Ghostscript 9.05 being available as follows:

GPL Ghostscript 9.05 (2012-02-08)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.

On another Win 7 computer, the command

ps2pdf -v -

at the command line is not recognised as being a valid ps2pdfsyntax but rungs -v works fine.

I have read on the internet about setting temporary directories for Ghostscript here:

http://schlingel.bplaced.net/?p=54

and it says basically to edit the gssetgs.bat file in the lib folder of Ghostscript and add the lines:

set path=%ProgramFiles%\gs\gs9.02\lib;%ProgramFiles%\gs\gs9.02\bin;%windir%\SysWOW64
set TMP=%YOUR_TEMP%
set TEMP=%TMP%

This needs to be modified appropriately by replacing 9.02 with 9.05 in my case. Now on Win 7, how should the last two lines regarding the temporary folder be? Can I have for Set TMP as follows:

set TMP=%"C:\Users\hihi\AppData\Local\Temp"%

Is it the right syntax?

I have also put the tmp and temp variables in my Environment variables.

Update

A. Using ps2pdf, here is how I convert a PS to a PDF file on my Win 7 machine and I get an error:

C:\work\misc>ps2pdf -dNOSAFER -sDEVICE=pdfwrite -r720 -dCompatibilityLevel=1.5 -dUseFlateCompression=true -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -dEPSCrop "%1.ps" "%1.pdf"


Unknown device:
Unrecoverable error: undefined in .uninstallpagedevice
Operand stack:
defaultdevice

Note: the above command works fine on my Win XP machine!

B. Using gswin32c here is how I convert a PS to a PDF file on my Win 7 machine and this works:

C:\work\misc>gswin32c.exe -o "%1.pdf" -dNOSAFER -sDEVICE=pdfwrite -r720 dCompatibilityLevel=1.5 -dUseFlateCompression=true -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -dNumRenderingThreads=2 -c "60000000 setvmthreshold" -f -dEPSCrop "%1.ps"


GPL Ghostscript 9.05 (2012-02-08)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Loading NimbusSanL-Regu font from %rom%Resource/Font/NimbusSanL-Regu... 2837152
1454727 4413848 3026018 1 done.
Loading Dingbats font from %rom%Resource/Font/Dingbats... 2837152 1510862 457461
6 3180865 1 done.
Loading NimbusSanL-Bold font from %rom%Resource/Font/NimbusSanL-Bold... 2857248
1553499 4655000 3251960 1 done.

Note: the above command also works fine on my Win XP machine

To summarise: I have problem with ps2pdf on my Win 7 machine.

New (May 09, 2012)

This is what I get when I rem the last two lines as Ken suggested:

C:\work\misc>ps2pdf -dNOSAFER -r720 -dCompatibilityLevel=1.5 -dUseFlateCompression=true -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -dEPSCrop "%1.ps" "%1.pdf"
Unrecoverable error: typecheck in .putdeviceprops
avoiding clean up

The temp folder has those temporary files you mentioned.

The contents of _.at:

-dCompatibilityLevel#1.4 
-dNOSAFER 
-r720 
-dCompatibilityLevel 

The contents of _.at2:

-q -P- -dSAFER -dNOPAUSE -dBATCH -sDEVICE#pdfwrite 
-sOutputFile#-dUseFlateCompression 
-dCompatibilityLevel#1.4 
-dNOSAFER 
-r720 
-dCompatibilityLevel 
-c .setpdfwrite -f1.5 

Update May 11

Note: This is working fine now on my win 7 machine

C:\work\misc>ps2pdf -dNOSAFER -r720 -dCompatibilityLevel#1.5 -dUseFlateCompression#true -dMaxSubsetPct#100 -dSubsetFonts#true -dEmbedAllFonts#true -dEPSCrop "defense.ps" "defense.pdf"
avoiding clean up

The contents of _.at:

-dCompatibilityLevel#1.4 
-dNOSAFER 
-r720 
-dCompatibilityLevel#1.5 
-dUseFlateCompression#true 
-dMaxSubsetPct#100 
-dSubsetFonts#true 
-dEmbedAllFonts#true 
-dEPSCrop 

The contents of _.at2:

-q -P- -dSAFER -dNOPAUSE -dBATCH -sDEVICE#pdfwrite 
-sOutputFile#"defense.pdf" 
-dCompatibilityLevel#1.4 
-dNOSAFER 
-r720 
-dCompatibilityLevel#1.5 
-dUseFlateCompression#true 
-dMaxSubsetPct#100 
-dSubsetFonts#true 
-dEmbedAllFonts#true 
-dEPSCrop 
-c .setpdfwrite -f"defense.ps" 

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T02:11:53+00:00Added an answer on June 3, 2026 at 2:11 am

    Far more likely than a temporary file problem is permissions on the directory where you are trying to write the destination file. The error message you quote occurs long before any temporary files are used, but is a very common error if you try to write to a directory which does not exist, or which the process has no write permission for.

    First thing to do is post the actual gswin32 command line you are using.

    The syntax you are querying is incorrect. %value% is a Windows scripting operation which says ‘replace the stuff between the % signs by the named value’. So if I declare ‘set VAL=c:/temp’ Then I can say ‘set NEWVAL=%VAL%/New’ which will make NEWVAL ‘c:/temp/new’. You can find more about windows scripting in the Windows help, or by a quick Google.

    Given that ‘ps2pdf’ (which is a Windows script) can’t be found on your Windows 7 machine (at least I assume that’s what you mean by ‘is not recognised as being a valid ps2pdf command’) it does seem like you need to add the Ghostscript paths to your environment. Simply altering gssetgs.bat on its own will do nothing, you need to ensure that this script file is called from your autoexec.bat script, so that the additional environment settings are applied.

    If you aren’t sure what autoexec.bat is, or how to modify it, then again Google should help you pretty quickly.

    Did you actually install Ghostscript, or simply copy it ?

    Given that Ghostscript works correctly, the problem must be in the shell script ‘ps2pdf’, or more accurately some change in Windows 7 is causing the old script not to work.

    This script is (unfortunately) rather more complex than I would like (I didn’t write it). it actually uses about three different scripts to do the work. You really need to find out what is being sent to GS.

    Probably the simplest way to do this is to edit ‘ps2pdfxx.bat’. At the :end label you’ll see ‘rem Clean up’ followed by two lines beginning ‘if exist’. Put rem in front of those two. Add a line which says ‘echo avoiding clean up’ The end of the file should look like this:

    :end
    rem Clean up.
    rem if exist “%TEMP%_.at” erase “%TEMP%_.at”
    rem if exist “%TEMP%_.at”2 erase “%TEMP%_.at”2
    echo avoiding clean up

    Now run your command line (by the way you really don’t need to put -sDEVICE= when using ps2pdf…..)

    In your TEMP directory you should have files called _.at and possibly _.at2 which will contain the actual commands being sent to GS.

    OK the file _.at is copied into the file .at2, and then.at2 is used as the list of arguments to Ghostscript. Commenting up the file you got:

    —This line added by the batch file ps2pdfxx.bat
    -q -P- -dSAFER -dNOPAUSE -dBATCH -sDEVICE#pdfwrite

    —These lines come from _.at
    -sOutputFile#-dUseFlateCompression
    -dCompatibilityLevel#1.4
    -dNOSAFER
    -r720
    -dCompatibilityLevel

    –This line added by the batch file ps2pdfxx.bat
    -c .setpdfwrite -f1.5

    There are a number of problems with this:

    -sOutputFile#-dUseFlateCompression

    This in effect sets the output file to ‘-dUseFlateCompression’

    -c .setpdfwrite -f1.5

    I’m not completely sure what this will do. Either it will handle the -f properly and terminate the PostScript input, or it will ignore it as an unrecognised switch (probably the latter). The ‘1.5’ ought to be the input filename, without that Ghostscript doesn’t know which file to use….. Even if it did, it will try to write the output to a bogus filename.

    To be honest I would suggest that, if you want to set all these switches, you simply invoke Ghostscript directly rather than trying to use the script. In fact I’d recommend that anyway, every time I look at these scripts I shudder more.

    Almost everything that the ps2pdf script is doing is being overridden by your command line, or is not required in the first place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the latest 64 bit version of PostgreSQL. I am running Win 7
I have a 32 bit machine and I am running Ubuntu 9.10 on it.
I do have the latest Android API and a ICS emulator running, but I
I have the latest Nginx running with Passenger, SQLite and Rails 3.1. Somehow, when
I have installed latest version of pligg on my local server. It's running fine.
I'm running Windows XP SP3 and I do have the latest .NET libraries installed,
These jars are both new released and have the latest solutions for Java EE
I have the latest ReSharper 5.0 build (1655), where I have encountered the suggestion
I have the latest version of STS and the latest version of the JDK
I have the latest Qt SDK. I'm trying to configure it for static building

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.