[gs-devel] Environment Variables

Chris Liddell chris.liddell at artifex.com
Wed Apr 14 14:02:22 UTC 2010


On 14/04/2010 14:52, lsulton wrote:
> 
> Good stuff, Ken. Windows 2003 will let me add an system-level environment
> variable, so I should be able to do it without a hitch through the control
> panel. 
> 
> The software that's invoking GS ends up producing a bitmap image that's
> being embedded in yet another PDF (through Distiller) ... GS is being used
> by that application to render a PDF within a document as a graphic ... the
> resulting PDF output is less-than-stellar in image quality, so I was hoping
> that upping the resolution of what GS does to render the bitmap will help
> ...
> 
> So, if I add the GS_OPTIONS as the system-level environment name, I'm still
> not sure what the optimal value should be to affect ALL bitmap creation
> resolution. 

If the software that's invoking GS specifies a resolution on the command
line, you're probably out of luck. The environment variables are
secondary to the command line options.

If, on the other hand, it doesn't already set a resolution using
GS_OPTIONS="-r600"

would make all (at least, bitmap/raster) output be created at 600 dpi.

But, as I say, this is dependent on the existing call to GS not
specifying a resolution.

HTH,

Chris


> Ken Sharp wrote:
>>
>> At 04:16 14/04/2010 -0700, lsulton wrote:
>>
>>> Is there a straightforward way to "permanently" set GS environment
>>> variables? Specifically, I want to render ALL PDFs created with GS at 600
>>> dpi ... the software that's calling GS doesn't have the ability to include
> a
>>> "switch", so I want to sort of set-it-and-forget-it ... make sense?
>>
>> Well, the resolution generally has little effect on a PDF output, this
>> only 
>> matters when an input primitive cannot be represented as an output 
>> primitive and must be converted to an image. In general we try to avoid 
>> those. The only case I can think of at the moment is if you set 
>> -dUseCIEColor=true and have certain kinds of gradient fill but there are 
>> probablly others.
>>
>> Anyway, the GS_OPTIONS environment variable allows you to create a set of 
>> options just as if you were typing them at the command line.
>>
>> On Windows you can set the environment variable in a command shell, which 
>> will only persist for the life of the shell, and only be defined within 
>> that shell.
>>
>> Alternatively (and generally more usefully) you can set an environment 
>> variable for the system. Use Control Panel->System, select 'Advanced
>> System 
>> settings' on the list to the left and OK the UAC dialog if you get one. 
>> Press the 'environment variables' button on the resulting dialog.
>>
>> Press the 'New' button, set the variable name to GS_OPTIONS variable, and 
>> define its value.
>>
>>
>> Please note the instructions above are for Windows Vista, I don't have a 
>> copy of Windows Server 2003, though I believe its similar.
>>
>>
>>              Ken
>>
>> _______________________________________________
>> gs-devel mailing list
>> gs-devel at ghostscript.com
>> http://ghostscript.com/cgi-bin/mailman/listinfo/gs-devel
>>
>>
> 



More information about the gs-devel mailing list