Red Hat Linux 7 Unleashed

Red Hat Linux 7 Unleashed

By William Ball

Displaying and Printing Graphics

PostScript is the most common graphics and document format when preparing documents and graphics under UNIX and Linux. Although many editors can prepare documents in ASCII text, HTML, LaTeX, or other markup languages, most applications, including graphics editors, will convert output to PostScript for printing. This is an advantage, because PostScript provides a common platform and document standard for handling by a number of Linux clients, and documents saved to a file may be previewed instead of being sent directly to a printer. You'll find a number of PostScript previewers and utilities included with Red Hat Linux, as shown in Table 8.6.

Table 8.6. Linux PostScript Utilities

Name Description
enscript Translates text to PostScript
gs PostScript interpreter
gv PostScript and PDF previewer
mpage Creates multi-page PostScript documents
pbmtoepsi Translates bitmap to EPSF
pbmtolps Translates portable bitmap to PostScript
pdf2dsc Creates PostScript page list of a PDF document
pdf2ps Translates PDF to PostScript
pdftops Translates PDF to PostScript
pnmtops Translates portable anymap to PostScript
ps2ascii Translates PostScript or PDF to text
ps2pdf Translates PostScript to PDF
psidtopgm Translates PostScript image data to portable graymap
pstopnm Translates PostScript to portable anymap
sgml2latex Creates LaTeX, DVI, or PostScript from SGML

Does this mean that you must use PostScript for printing? Of course not! But using PostScript may help ensure consistent handling and output quality of your documents. To view a PostScript graphic or document, use an associated client, such as the gv PostScript previewer. You'll find example PostScript graphics under the /usr/share/ghostscript/5.50/examples/ directory, or you can create a PostScript document for previewing from an existing text document using the mpage command.

For example, to view the graphic tiger.ps, use the gv command from the command line of a terminal window like this:


   # gv /usr/share/ghostscript/5.50/examples/tiger.ps

After you press Enter, you'll see the graphic in gv's main window, as shown in Figure 8.9.

08fig09.jpg

Figure 8.9 The gv client previews, rotates, scales, and prints PostScript documents, or selected pages of PostScript documents.

You can use gv's various menus to rotate the image, reduce or enlarge the display, page through, or print selected pages of multi-page PostScript documents. Another client included with Red Hat Linux to support previewing PostScript is KDE's kghostview previewer.

If you'd like to display other types of graphics, use the display command, part of the ImageMagick software package. This command may be used to display one or more images, or a visual directory of images, and has many different features. For example, to display a single visual directory of all PCX files in a directory, use the display command like this:


   # display 'vid:*pcx'

After you press Enter, a single window with a series of thumbnail images will be displayed, as shown in Figure 8.10.

08fig10.jpg

Figure 8.10 The display command features a handy thumbnail visual directory.

To load an image for display, editing, conversion, transformation, or printing, move your cursor to a thumbnail image, then right-click the image. You'll see a pop-up menu that allows you to load the image.

Each of the previewers discussed here has the ability to print documents, but you can also print a graphic directly from the command line. For example, to print the tiger.ps graphic, use the lpr to spool the file for printing, like this:


   # lpr /usr/share/ghostscript/5.50/examples/tiger.ps

This will send the graphic to the default printer. Red Hat Linux uses intelligent print filters that will automatically translate a file with the proper extension (such as .ps) into the proper printer control language. The printing system recognizes and prints the following types of graphics:

Share ThisShare This

Informit Network