img-ps(3tk)

πŸ“¦
version 2.1.1 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– img-ps β€” bestie's guide to PostScript & PDF in Tk πŸ’–

okay so real talk, this is the img-ps page from the Img manual (section 3tk), and it's literally the glow-up that lets your Tk photo images eat PostScript and PDF files. no cap. let's get into it πŸ¦‹


✨ NAME ✨

img-ps β€” PostScript and PDF format (ps) πŸ’…


✨ SYNOPSIS ✨

package require img::ps ?2.1?

✨ DESCRIPTION ✨

so like, package require img::ps β€” that's the whole vibe. 🌸

Like every single package in Img, it does not hand you brand new commands. nope. what it does is extend the existing Tk command image, so that image suddenly understands files holding raster images in the PostScript and PDF format (ps). more specifically, img::ps extends Tk's photo image type (https://www.tcl.tk/man/tcl9.0/TkCmd/photo.html). icon behavior fr fr πŸ’–

The name of the new format handler is ps. This handler is giving new additional configuration options. see the Options section below for the full breakdown, bestie.

πŸ‘€ and yes β€” this package ALSO provides a pdf handler, i.e. a handler for the Adobe Portable Document Format. That handler accepts the exact same options as the ps handler. two for one, we love to see it.

The package delegates the actual conversion of data in PostScript and PDF format into a raster image to the GhostScript application. so it depends upon the presence of program gs on Unix and gswin64c.exe in environment variable PATH, and it is non-functional if GhostScript is not installed. πŸ’€ like, it simply will not work. that's the whole thing.

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. she just knows. πŸ”₯
  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. so you gotta ask for her by name, periodt. ✨


✨ NOTES ✨

  1. This format handler only supports read functionality. no writing, only reading, that's her lane. πŸ™ˆ
  2. Chapter Multi-page Images 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:

✨ 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. so if you're nosy, turn it on πŸ‘‘
  • -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. zoom zoom πŸ’«
  • -gs string β€” Available since version 2.0. Specify the GhostScript executable program as absolute path. path, absolute, don't be cute about it 🌈

✨ 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 β€” the whole squad, go say hi 🫢


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>


and that's the whole page, bestie πŸ’œ this is img-ps version 2.1, from the Img manual, img-ps(3tk). stan. mwah πŸ’…βœ¨

πŸ“¦ where this page comes from