-->
Previous Table of Contents Next


Ghostview

Ghostview is a utility to display PostScript files on the screen. Ghostview was written by Tim Theisen, not by Aladdin Enterprises, and is freely available on the Internet and through CD-ROM collections. Ghostview uses Ghostscript to display the contents, but doesn’t require Ghostscript to be installed first.

The Ghostview utility is easy to run. To display the contents of the file chapter1.ps on your X screen, you would issue the command:


ghostview chapter1.ps

Most users learn to rename or alias the ghostview command to something a lot shorter, such as gv, to make using it easier and faster to type. To alias the command ghostview to gv in the tcsh shell, for example, simply enter:


alias gv ghostview

Ghostview’s main window is a little more involved than the simple output window Ghostscript displays. The Ghostview main window is shown in Figure 24.5.


Figure 24.5.  The Ghostview main window shows the file being displayed by navigation shortcuts.

The Ghostview Panel

As you can see, the file you’re displaying is in the right-hand page of the window just as it would appear using Ghostscript (which is actually what happens as Ghostview calls Ghostscript for this part of the routine). The scroll bar in the right margin lets you move through the file quickly, or you can use the page numbers on the left to move quickly to any page.

There are five buttons in the left-hand panel:

  File. Lets you open, reopen, or print a file, as well as display copyright information and exit Ghostview.
  Page. Controls which page is shown in the view panel. There are a number of options that are straightforward: Next moves to the next page, Previous moves to the previous page, Redisplay redraws the screen, Mark marks a page in the Table of Contents, and Unmark removes a mark.
  Magstep. Changes the magnification of the panel in the right portion of the Ghostview window.
  Orientation. Lets you move between landscape and portrait modes, as well as flip an image upside down or rotate 90 degrees.
  Media. Lets you change page sizes.

You’ll find Ghostview quick and easy to work with after using it a couple of times. The top of the Ghostview window shows the version number, and the top of the left panel shows the title (if any) of the document you are displaying (PostScript allows document titles to be embedded in the page descriptor language). If no title is found, the file name is shown instead. The date underneath the title is either a date embedded in the PostScript file or the file’s modification date.


Tip:  
One feature of Ghostview that may have you puzzled for a moment is the way pages are displayed after being minimized and expanded. When you shrink a Ghostview window to its icon, Ghostview retains all the images of the files in memory. However, when you expand the window, Ghostview first checks to see whether the file has been changed since the minimization. This can cause a slight delay in the window appearing again, especially with very large documents. Despite the delay, this is a very useful feature—it means you always have the most recent version of the document displayed.

Despite the simple look of the Ghostview window, there are a huge number of options the command supports. They tend to replace either X resources or environment variable options explained in the Ghostview documentation.

Ghostview Fonts

By default Ghostview comes with a set of PostScript type 1 and 3 fonts, which should cover every document you’re likely to run into. However, you can add your own fonts to Ghostview’s arsenal. The fonts need to be placed in the Ghostscript fonts subdirectory, such as /usr/share/ghostscript/3.33/fonts.

You also have to edit the file Fontmap to tell Ghostview and Ghostscript about the new fonts. The format of each entry in Fontmap is simple, showing the name of the font and the file that contains it, such as the following, where funnyfont is the name of the font and fun_fnt.pfb is the PostScript definition file:


funnyfont (fun_fnt.pfb);


Previous Table of Contents Next