img-ps(3tk)

NAME
img-ps - PostScript and PDF format (ps)

SYNOPSIS
package require img::ps ?2.1?

DESCRIPTION
package require img::ps

Like all packages of Img it does not provide new commands, but extends the existing Tk command image, so that it supports files containing raster images in the PostScript and PDF format (ps). More specifically img::ps extends Tk's photo [https://www.tcl.tk/man/tcl9.0/TkCmd/photo.html] image type.

The name of the new format handler is ps. This handler provides new additional configuration options. See section Options for more detailed explanations.

Note that this package provides a pdf handler too, i.e. a handler for the Adobe Portable Document Format. That handler accepts the same options as the ps handler.

The package delegates the actual conversion of data in PostScript and PDF format into a raster image to the GhostScript application. It therefore depends upon the presence of program gs on Unix and gswin64c.exe in environment variable PATH and is non-functional, if GhostScript is not installed.

All of the above means that in a call like image create photo ?name? ?options?

[1] Image data in PostScript and PDF format (options -data and -file) is detected automatically.

[2] The format names ps and pdf are recognized by the option -format.

In addition the value for the option is treated as list and may contain any of the special options listed in section Options.

The package img::ps is not loaded when doing a package require Img, but must be loaded explicitly via package require img::ps.

NOTES

[1] This format handler only supports read functionality.

[2] Chapter Multi-page Images of of the Img manual page describes the handling of images with multiple pages.

[3] This format handler only supports a limited number of file types:

    •   PostScript files must have keyword %%BoundingBox in the file header. The syntax %%BoundingBox (atend) is not supported.

    •   PDF files are assumed to be of size DIN A4. It is recommend to use a specialized PDF extension like tclMuPDF [https://sourceforge.net/projects/irrational-numbers/files/tclMuPDF-2.x/].

OPTIONS
The handler provides the following options:

-verbose bool
    Available since version 2.0.

    If set to true, additional information about the read image is printed to stdout. Default is false.

-index integer
    Available since version 1.2.4.

    Read the page at specified index. The first page is at index 0. Default is 0.

-zoom x ?y?
    Available since version 1.2.4.

    Scale image by specified double values. If y is not specified, it is set to the value of x. Default is 1.0.

-gs string
    Available since version 2.0.

    Specify the GhostScript executable program as absolute path.

SEE ALSO
img, img-bmp, img-dted, img-flir, img-gif, img-ico, img-jpeg, img-pcx, img-pixmap, img-png, img-ppm, img-ps, img-raw, img-sgi, img-sun, img-tga, img-tiff, img-window, img-xbm, img-xpm

COPYRIGHT
Copyright (c) 1995-2025 Jan Nijtmans <nijtmans@users.sourceforge.net>
Copyright (c) 2002-2025 Andreas Kupries <andreas_kupries@users.sourceforge.net>
Copyright (c) 2003-2025 Paul Obermeier <obermeier@users.sourceforge.net>