Ghostscript new (minor) version

Bruno Voisin bvoisin at icloud.com
Sun May 19 02:07:13 CEST 2024


Karl wrote:

> Is gs restricting all use of setpagedevice?
> Hopefully not.
> 
> I could not tell from the diffs. I do not know how to change the gs
> output device from PostScript in the first place, and I couldn't find it
> in the docs. Tom, anyone?

The doc of the development version, towards the end of

https://ghostscript.readthedocs.io/en/latest/Use.html#other-parameters

says

> Device selection is controlled by it’s own parameter :
> 
> --permit-devices=devicelist
> 
> devicelist is a comma-separated list of devices known to Ghostscript which may be selected using the /OutputDevice key in a dictionary supplied to setpagedevice. The device names must be as they are known to Ghostscript (use gs --help for a list). Attempting to select a device not on this list will result in an invalidaccess error. For convenience the single character ‘*’ may be used to permit any device.
> 
> In addition some devices have parameters which are inherently unsafe (e.g. the IJS device’s IjsServer parameter). Attempting to alter these parameters after SAFER is active will result in an invalidaccess error. These parameters can only be set from the command line when SAFER is selected.

This seems to imply it's only the combination of setpagedevice and /OutputDevice which is restricted.

An example of device selection is given towards the end of

https://ghostscript.readthedocs.io/en/latest/Language.html#device-operators

namely

> <device> setdevice -
> 
> Sets the current device to the specified device. Also resets the transformation and clipping path to the initial values for the device. Signals an invalidaccess error if the device is a prototype or if .LockSafetyParams is true for the current device.
> 
> Some device properties may need to be set before setdevice is called. For example, the pdfwrite device will try to open its output file, causing an undefinedfilename error if OutputFile hasn’t been set to a valid filename. In such cases use the level 2 operator instead: << /OutputDevice /pdfwrite /OutputFile (MyPDF.pdf) >> setpagedevice.

Bruno




More information about the tex-live mailing list.