Overview

GSview is a graphical interface for Ghostscript under MS-Windows or OS/2. Ghostscript is an interpreter for the PostScript page description language used by laser printers. For documents following the Adobe PostScript Document Structuring Conventions, GSview allows selected pages to be viewed or printed. GSview 1.63 beta requires Ghostscript 4.01. GSview was inspired by Tim Theisen's X11 Ghostview program.

Installation

Document Structuring Conventions

Opening a Document

Page Selection

Zoom

Document Information

Printing

Text Extract and Find

Clipboard

EPS Preview

Options

Page Orientation

Display Settings

Page Size

Keys

Running GSview from the File Manager or Windows Explorer

Command line options

World Wide Web

Copyright

Common Problems

Other Help Topics

Internals


Installation

It is recommended that you use the installation program for installing GSview. This is called setup.exe for MS-Windows and os2setup.exe for OS/2. The installation program will install both GSview and Ghostscript.

If you wish to install GSview manually, see the Manual Installation topic.

Uninstalling GSview and Ghostscript

Manual Installation

Network Installation

Ghostscript Installation

Include Path

Fonts

Portable Document Format


Uninstalling GSview and Ghostscript

To uninstall GSview, remove the files in the gsview  directory. To uninstall Ghostscript, remove the files in the gs4.01 directory.

Also remove

 c:\windows\gsview32.ini

from the appropriate system directory.

Remove the GS Tools group from the Program Manager or Start menu

If you know how to edit the registry, remove the following keys:

 psfile

 .eps

 .ps


Manual Installation

It is recommended that you use the installation program for installing GSview.  The following instructions describe how to install GSview without using the installation program.

Set the environment variable TEMP to point to a directory for temporary files.  For example:

  SET TEMP=c:\temp

The directory must exist and must be writeable.

First you need to install Ghostscript, plus its library files and fonts. You need the Ghostscript version listed in Overview. This version of GSview will not work with other versions of Ghostscript. Install Ghostscript in a directory c:\gstools\gsN.NN (Replace N.NN by the Ghostscript version number.)

Make a directory c:\gstools\gsview

Next install GSview for Windows by copying gsview32.exe, gsv16spl.exe, gvwgs.exe, gsview.hlp and printer.ini to the c:\gstools\gsview directory.

Start GSview then answer 'Yes' to all the configuration questions.

This will automatically configure Options | Configure Ghostscript, copy a list of known printers to the INI file, create file associations in the registry and create a program manager group.

If you want to put GSview and Ghostscript somewhere other than the default location, it is a little more tricky.

Copy the GSview and Ghostscript files to the destination, then start GSview. Answer "No" to "Proceed with configuration of GSview".

Select Options | Configure Ghostscript. In the Ghostscript DLL field enter the full path to the Ghostscript DLL.

  c:\gstools\gsN.NN\gsdll32.dll

Enter the correct Ghostscript include path into the Ghostscript Include Path field. This include path must include the directories where the Ghostscript library files (gs_*.ps and Fontmap) and the Ghostscript fonts (*.gsf) are located. For example:

  c:\gstools\gsN.NN;c:\gstools\gsN.NN\fonts

Do NOT put a -I before the include path.

Leave the Ghostscript Options field empty.

If you do not get the Ghostscript DLL field correct, GSview will not be able to load Ghostscript. If you do not get the Ghostscript Include Path correct, Ghostscript will not initialise and will then unload.

Exit GSview, then append printer.ini to the GSview INI file (c:\windows\gsview32.ini or c:\os2\gvpm.ini)

Create a Program Manager or Start Menu item for GSview.

Add the .ps and .eps file types to the Registry.

If you have some Type 1 fonts on your system, it may be possible to tell Ghostscript to use them.  See Fontmap.os2 and Fontmap.atm supplied with Ghostscript for examples.  See the Fonts topic.

If you have problems, try reading the help topic Common Problems.


Network Installation

Install GSview to a network directory.

When a user starts GSview for the first time, or starts GSview after the version number has changed, GSview will configure the local computer.

Using a UNC path with installing GSview probably will not work from Windows 3.1, but does work from Windows 95.


Ghostscript Installation

WARNING: SOME OF THE INFORMATION BELOW IS OLD.

The following describes how to install Ghostscript, not GSview. The primary documentation on installing Ghostscript is found in the Ghostscript file install.txt.

Aladdin Ghostscript for the PC is available on the Internet from

 ftp://ftp.cs.wisc.edu/ghost/aladdin/gsNNN???.zip

Where NNN is the version number.

For Ghostscript N.NN, the files requires to run Ghostscript are:

All PC platforms require the library (INI) files in

 gsNNNini.zip

If you do not already have a set of Type 1 fonts, you will need

 gsNNNfn1.zip

To run Ghostscript in conjunction with GSview you need one or more of the Ghostscript DLLs:

 gsNNNos2.zip   (OS/2 2.0 or later DLL)

 gsNNNw32.zip   (MS-Windows 3.1/Win32s, 95 or NT)

The following assumes that Ghostscript is to be installed on drive d:. Unzip the INI zip file and the required DLL and EXE zip files from the root directory.  This should put the files into the directory d:\gsN.NN.

If you also need the fonts, change to the d:\gsN.NN directory and then unzip gsNNNfn1.zip.  This will put font files into .\fonts.

To run Ghostscript without GSview, set the GS_LIB environment variable as follows

 SET GS_LIB=d:\gsN.NN;d:\gsN.NN\fonts

then start the appropriate EXE.  To run Ghostscript without using the environment variable, use the following command

 d:\gsN.NN\gs -Id:\gsN.NN;d:\gsN.NN\fonts

where the EXE name needs to be replaced with the appropriate name (gs, gs386, gswin16, gswin32 or gsos2).

If you already have some Type 1 fonts, there are two ways to tell Ghostscript about these fonts: editing/replacing the Fontmap file, or the GS_FONTPATH environment variable.  See the Ghostscript use.txt and the sample Fontmap files for details.

See the Include Path and Fonts topics for more details.


Include Path

Ghostscript needs to read some initialisation files during startup, and needs to read font files before drawing text. Ghostscript must be told where to find these files by using the Ghostscript -I command line switch or the GS_LIB environment variable can be used. See below for details for Unix or VMS.

The -I switch or GS_LIB environment variable contains a list of directories to search for the required initialisation files. On a PC, it is normal to put the initialisation files in the same directory as the Ghostscript program.  If Ghostscript is in c:\gs, then -Ic:\gs would be used as a command line option to Ghostscript.

Ghostscript also needs to find font files.  The list of fonts known to Ghostscript is contained in the Fontmap file.  The directories which contain these fonts should be added to the -I switch. If the Ghostscript *.pfb fonts are in c:\gs\fonts, and some other *.pfb fonts are in c:\psfonts, then -Ic:\gs;c:\gs\fonts;c:\psfonts would be used as a command line option to Ghostscript on a PC.

Under Unix or VMS with Ghostview, the include path should have been configured when Ghostscript was compiled. If not, and Ghostview is being used, use the GS_LIB environment variable instead of -I. The Ghostscript include files are generally not put in the same directory as the executable under Unix.  Instead the executable might be in

 /usr/local/bin

while the include files are in

 /usr/local/lib/ghostscript/gsN.NN

and the fonts in

 /usr/local/lib/ghostscript/fonts

Consequently, the GS_LIB environment variable would need to be set to

 /usr/local/lib/ghostscript/gsN.NN:/usr/local/lib/ghostscript/fonts

It is to be hoped that these were set as the default when Ghostscript was compiled, and that it is unnecessary to use GS_LIB.

For more information, see the following topic.

File searching


File searching

(from Ghostscript use.txt)

When looking for the initialisation files (gs_*.ps), the files related to fonts (Fontmap, *.pfa, *.pfb, *.gsf), or the file for the 'run' operator, Ghostscript first checks whether the file name specifies an explicit directory or drive (i.e., doesn't begin with '/' on Unix systems; doesn't contain a ':' or begin with a '/' or '\' on MS-DOS systems; doesn't contain a ':' or a square bracket on VMS systems).  If it does, Ghostscript simply tries to open the file using the given name.  Otherwise, Ghostscript will try directories in the following order:

1. The directory/ies specified by the -I switch(es) in the command line (see below), if any;

2. The directory/ies specified by the GS_LIB environment variable, if any;

3. The directory/ies specified by the GS_LIB_DEFAULT macro in the Ghostscript makefile, if any.

Each of these (GS_LIB_DEFAULT, GS_LIB, and -I parameter) may be either a single directory, or a list of directories separated by a character appropriate for the operating system (':' on Unix systems, ';' on VMS systems, ';' on MS-DOS systems).


Fonts

Ghostscript locates fonts in two ways:

1. Those listed explicitly in Fontmap

2. Font files found in directories listed in the GS_FONTPATH environment variable.

Those listed in the Fontmap file should be locatable on the Ghostscript include path, or should have fully qualified paths.  Note that you must use / or \\ and must not use \ within a directory name.

Ghostscript now comes with a good quality set of free fonts. Most have a .pfb extension and can be used with Adobe Type Manager. The Ghostscript fonts can be broken into three main classes:

1. Type 1 outline fonts with hinting (*.pfb and most *.pfa). These produce good quality output.  The standard Fontmap file uses these in preference to the other font types. A full set of the common 35 PostScript fonts is available.

2. Type 1 outline fonts that have been created from bitmap fonts (*.gsf).  These produce poor quality output. These are ordinary Type 1 fonts (although they cannot be used with Adobe Type Manager). Avoid them if at all possible.

3. Type 1 stroked fonts created from the public domain Hershey fonts (h*.gsf, h*.pfa).  These produce moderate quality output, but do not correspond to standard PostScript fonts.

If you have some other Type 1 outline fonts (*.pfa, *.pfb), it is possible to use these with Ghostscript.  Whether or not you are allowed to do this depends on the font licence.  If you do use these fonts with Ghostscript, it is your responsibility to make sure that the font licence permits this use. To use the other Type 1 fonts, you will need to replace or edit the Fontmap file, or use GS_FONTPATH.

Fontmap

GS_FONTPATH

Platform Fonts


Fontmap

The Fontmap file tells Ghostscript what fonts are available and where to find them. Each line in Fontmap may be one of the following:

1. A comment.  These are lines that start with a %

   % fontmap aka Fontmap - standard font catalog for Ghostscript.

2. A font name and file name.  For example

   /Courier                (ncrr.pfa)      ;

   /Courier-Italic         (ncrri.pfa)     ;

The first of these lines says that the font name Courier is to be found in the file ncrr.pfa. The file ncrr.pfa must contain a font named Courier. If the name is not Courier then a font alias must be used. This is described later. Note that the file name is a PostScript string and so \ has a special meaning. If ncrr.pfa was in the c:\gs\fonts directory, you would need to have c:\gs\fonts as one of the directories listed in the include path, or you would need to use the file name (c:/gs/fonts/ncrr.pfa) or (c:\\gs\\fonts\\ncrr.pfa).  Using / is preferred to \\.

3. A font alias. For example

   /Courier-Oblique                /Courier-Italic         ;

This tells Ghostscript that if Courier-Oblique is requested, Courier-Italic is to be used instead. The standard Fontmap file uses aliases to replace poor quality bitmap-derived fonts with good quality hinted outline fonts. Ghostscript has a bitmap derived version of the Helvetica font in the file phvr.gsf.  The Fontmap file could instruct Ghostscript to use this with the following line:

   /Helvetica                      (phvr.gsf)      ;

However, the NimbusSansL-Regular font looks like Helvetica and is a better quality font, so the default Fontmap file actually uses

   /Helvetica                      /NimbusSansL-Regular    ;

   /NimbusSansL-Regular            (n019003l.gsf)  ;

A description of the required formatting for each line is near the top of each Fontmap file.

Ghostscript comes with a number of alternate Fontmap files. These include

 Fontmap        The standard fontmap file

 Fontmap.ATB    For Adobe Type Basics (65 Type 1 fonts)

 Fontmap.ATM    For Adobe Type Manager (13 fonts)

 Fontmap.OS2    For Type 1 fonts shipped with OS/2 (13 fonts)

 Fontmap.OSF    For DEC OSF/1 systems

 Fontmap.Ult    For DEC Ultrix systems

 Fontmap.VMS    For VAX/VMS systems with DECwindows/Motif

If you want to use one of the alternate Fontmap files, the procedure is as follows:

1. Copy Fontmap to Fontmap.old

2. Copy Fontmap.??? (your selected Fontmap file) to Fontmap

3. Add the directory that contains the Type 1 fonts to the include path (-I or GS_LIB)


GS_FONTPATH

(From Ghostscript use.txt)

When Ghostscript first fails to find a font, it also looks at the GS_FONTPATH environment variable, which is also a list of directories. It goes to those directories and looks for all files that appear to contain PostScript fonts; it then effectively adds all those files and fonts to its internal copy of the Fontmap (the catalog of fonts and the files that contain them).  If you are using one of the following types of computer, you may wish to set GS_FONTPATH to the indicated value so that Ghostscript will automatically acquire all the installed Type 1 fonts:

   System type             GS_FONTPATH

   -----------             -----------

   AIX                     /usr/lpp/DPS/fonts/outlines

   NeXT                    /NextLibrary/Fonts/outline

   OSF/1                   /usr/lib/X11/fonts/Type1Adobe

   Silicon Graphics        /usr/lib/DPS/outline/base

   Sun (Solaris 2.3)       /usr/openwin/lib/X11/fonts/Type1/outline

   Ultrix                  /usr/lib/DPS/outline/decwin

See also Fontmap.


Platform Fonts

Platform fonts are described in Ghostscript fonts.txt.

WARNING: Text anti-aliasing will not work if platform fonts are used.  For this reason, GSview will automatically use -dNOPLATFONTS if text anti-aliasing is selected.

The description below was written when Ghostscript came with bitmap derived fonts of poor quality. Ghostscript now comes with Type 1 fonts of good quality.

The computer hosting Ghostscript may have the same fonts in better quality versions, either as scalable fonts (e.g. Type 1 or TrueType) or as bitmaps. To improve the display of documents, Ghostscript can use these platform fonts instead of using the low quality fonts.

This can be illustrated with an example.  The default /Helvetica-Bold font is phvb.gsf, an outline font derived from a bitmap.  When the /Helvetica-Bold font is requested, phvb.gsf is read.  When a character is to be rendered to the display, Ghostscript instead asks MS-Windows for the Helvetica-Bold font at the appropriate size.  MS-Windows then draws the requested character from the TrueType Arial Bold font, and Ghostscript puts it on the display.  The resulting output is of better quality than the /Helvetica-Bold bitmap derived font.

In another example, the same request for /Helvetica-Bold under Unix/X11 might instead display characters using a prebuilt bitmap font if one is available in the requested size.

There are some limitations to using Platform fonts.

1. Platform fonts are only used for upright (Portrait) characters. Rotated characters will be displayed using the original PostScript font.

2. A PostScript version of the required font must be available. This is needed to obtain character bounding box information, encoding vector for character sets, and drawing rotated characters.

3. Platform fonts may only used for a limited range of sizes. For example, MS-Windows only uses platform fonts for 6 to 36 point fonts.

4. MS-Windows lies about the available font sizes.  Ghostscript asks for a particular font size and MS-Windows returns a font that it claims is the same size.  However MS-Windows may instead return a font of a different size that it thinks will look better.  Often it looks worse because the intercharacter spacing is out of proportion to the character size.  If this happens, platform fonts can be disabled by adding -dNOPLATFONTS to the Ghostscript Command Line.

5. Platform fonts will only be used for the display.  Output to printer devices will continue to use the PostScript font.

MS-Windows Ghostscript has a fixed alias table for fonts. In the table below, the name on the left is the name of the PostScript font, and the name on the right is the name that Ghostscript will try if MS-Windows doesn't know the PostScript name.

 Courier         Courier New

 Helvetica       Arial

 Helvetica       Helv

 Times           Times New Roman

 Times           Tms Rmn

Platform fonts are not supported under OS/2.

Not yet written: Unix/X11 Ghostscript may have an ability to use Xresources to specify font aliases.  If this is the case, then the method should be described here.


Portable Document Format

GSview can display and print PDF files, although there are a number of problems with the current method.

Known problems with the current implemtentation are:

- GSview ignores the page size on the Media menu, and instead uses the /MediaBox from the PDF file.

- Zoom doesn't work if the PDF file uses a non-zero /Rotate.

- Doesn't sense if PDF file has been changed during display.

- Extracting PDF pages doesn't actually extract pages from the PDF file. Instead it writes a short PostScript file containing commands to display the PDF pages.  This PostScript file can be used by Ghostscript to print the pages, but sending it to a PostScript printer will not work.

- GSview needs to Open a PDF file to count the pages.  If you Select the file, GSview will not be able to Text Extract, Find, Goto Page or any other operation that needs to know how many pages are in the document.


Document Structuring Conventions

Adobe has defined a set of extended comment conventions that provide additional information about the page structure and resource requirements of a PostScript file. If a file contains these Document Structuring Convention (DSC) comments, GSview can display pages in random order using Goto Page and display pages in reverse order using Previous Page.  Selected pages can be extracted to another file or printed.

If a file does not contain DSC comments, GSview can only display the pages in the original order.

DSC conforming files start with the comment line:

 %!PS-Adobe-3.0

where the number 3.0 may change and is the DSC version number. Some programs write PostScript files with a control-D as the first character of the file, followed by the comment line mentioned above. GSview will correctly report that these files are not DSC conforming, but will still display them with page selection features available. Complain to the author of the program that produced the PostScript file. To make the file DSC conforming, edit it to remove the control-D character.

DSC conforming files contain lines such as:

 %%Pages: 24

 %%Page: 1 1

These lines tell GSview how many pages a document contains and where they start.  GSview uses this information to select individual pages.

Encapsulated PostScript Files (EPSF) are single page documents that contain a subset of the DSC comments and PostScript commands. EPS files start with the comment line:

 %!PS-Adobe-3.0 EPSF-3.0

EPS files are commonly used for inclusion in other documents and for this reason require the bounding box comment:

  %%BoundingBox: llx lly urx ury

where llx, lly, urx and ury are integers giving the x and y coordinates of the lower left and upper right corners of a bounding box which encloses all marks made on the page.

Some EPS files contain a preview of the PostScript document. This preview can be a Windows Metafile, a TIFF file, or an Interchange preview (EPSI format). For the Windows Metafile or TIFF file preview, the EPS file under DOS contains a binary header which specifies the location and lengths of the preview and PostScript language sections of the EPS file. For the Interchange format, the preview is contained in DSC comments starting with

 %%BeginPreview: width height depth lines

An EPS file with a preview can be created from an EPS file without a preview using Add EPS Preview.


Opening a Document

The Open command on the File menu opens a file and displays the first page.

If the file contains DSC comments, pages can be selected using Next Page, Previous Page and Goto Page.

If the file does not contain DSC comments, Previous Page and Goto Page will not work.  Another file should not be selected until a last page of the file has been displayed.

When a file is open, GSview will display the document filename, the current page (if available) and while the cursor is over the image, the location of the cursor in coordinates specified by Options | Units.  The coordinate can be PostScript points (1/72"), millimetres or inches. The cursor location is useful for calculating bounding boxes.

The Select File command is similar to Open but it does not display the document. This command is useful for opening a document prior to printing it.

The Save As command saves a copy of the current document. This is useful if GSview is being used as a PostScript viewer by another application and you wish to save the currently displayed file.

Extract allows a range of pages to be copied from the current document to a new document.  For example, ten pages can be extracted from the middle of the current document and written to another file, which will later be sent to a printer.

The Close command closes the currently open document. This should be used before the current file is changed by another program. If you do not do this and GSview detects that the file length or date have changed, it will close Ghostscript and rescan the document.

See also Print.

PS to EPS


PS to EPS

In general, it is not possible to convert a PostScript file to EPS. However, many single page PostScript files can be converted to EPS by changing the first line of the file to

 %!PS-Adobe-3.0 EPSF-3.0

and then adding or fixing up the %%BoundingBox comment.

When used incorrectly, the PS to EPS command can produce PostScript files with incorrect DSC comments.  Such a document will cause problems when you try to include it inside another document.

To convert a PostScript file to EPS, the original file must be a single page document.  If the document contains DSC comments and is multi page, extract the desired page with File | Extract. If the document does not contain DSC comments, you will need to edit the file by hand to extract the desired page.

EPS documents must not use any of the following operators:

 banddevice   clear         cleardictstack  copypage

 erasepage    exitserver    framedevice     grestoreall

 initclip     initgraphics  initmatrix      quit

 renderbands  setglobal     setpagedevice   setpageparams

 setshared    startjob      letter          note

 legal        a3            a4              a5

The following operators should be used with care:

 nulldevice   setgstate     sethalftone    setmatrix

 setscreen    settransfer   setcolortransfer

It is your responsibility to make sure that the above requirements are met.

To test if a document contains any of the above operators, select Options | EPS Warn and then Open the desired document. After the page has been displayed, Close the document and then display the Ghostscript messages with File | Show Messages. If any of the above operators have been used you should see lines like:

 Warning: EPS files must not use ...

If you find these warnings then do not use PS to EPS. Remember to turn off EPS Warn afterwards.

A document must be displayed before PS to EPS is used. The document must contain a showpage. This is required so that the bounding box can be measured.

For documents without DSC comments, PS to EPS allows a bounding box to be specified, then writes out an EPS file consisting of an EPS wrapper around the original document.

For documents with DSC comments, PS to EPS will change the first line of the file to

 %!PS-Adobe-3.0 EPSF-3.0

then allows the %%BoundingBox comment to be changed or added.

For EPS documents, PS to EPS allows the %%BoundingBox comment to be changed.

PS to EPS does not clip the document to the %%BoundingBox. To do so would require changing the PostScript code itself. PS to EPS only changes the DSC comments.

PS to EPS does not add a preview to a document. If you want a preview you add it with Edit | Add EPS Preview after first creating an EPS file with a correct %%BoundingBox.

See also Add EPS Preview, Extract, EPS Warn.


Page Selection

View | Next Page or the + button moves to the next page of a document. This works even if the document does not contain DSC comments.

View | Previous Page or the - button moves to the previous page.

View | Redisplay redisplays the current page.

View | Goto Page or the pointing hand button shows a dialog box which allows selection of the next page number to display. The Select Page dialog box shows page labels since these are likely to be more useful than a sequential page number.

View | Next Page and Home or the space bar moves to the top of the next page of a document.

View | Previous Page and Home or the BackSpace key moves to the top of the previous page.

The Previous Page, Redisplay and Goto Page commands work only if the document contains DSC comments.


Zoom

To enlarge a displayed feature, position the cross-hair mouse pointer over the feature then press the right mouse button. The window will swap from normal display resolution to zoom resolution and the status line will have the word Zoomed appended to it. The zoomed feature will be in the centre of the window. To cancel Zoom, press the right mouse button again or select any command that redraws the page (e.g. Redisplay, Next Page). By default the zoom resolution is 300 dots per inch but this can be changed with Media | Display Settings dialog box.

Zoom will only work for DSC conforming documents.

To enlarge or shrink the entire page, use the Resolution on the Media | Display Settings dialog box, use the magnifying glass toolbar buttons.


Document Information

A brief information area at the top of the window is used by GSview to display the document filename, the current page number and label (if available) and while the cursor is over the image, the location of the cursor in coordinates specified by Options | Units. The cursor location is useful for calculating bounding boxes.

The Info command on the File menu shows a dialog box with the following information about the DSC comments in the current document.

File is the full pathname to the document.

Type is DSC, EPS, No DSC comments or 'Ignoring DSC Comments'. EPS is an Encapsulated PostScript File - a single page document that contains a subset of the DSC comments and PostScript commands. EPS files are commonly used for inclusion in other documents. Ignoring DSC Comments is displayed if Options | Ignore DSC is selected.

Title is a text title that can be used when printing banner pages and for routing or recognising documents.

Date is the time the document was created.

BoundingBox specifies a box that encloses all the marks painted on the page.  The four integer values are the coordinates of the lower left and upper right corners of the bounding box in default user coordinates (1/72 inch).

Orientation is either Portrait or Landscape.

Default Media gives the media name followed by the width and height of that media in default user coordinates (1/72 inch).

Page Order is either Ascending, Descending or Special

Pages is the total number of pages in the document.

Page gives the page label and page number.

Bitmap is the size of the display bitmap in pixels which may be useful if you are copying the displayed image to the clipboard.


Printing

The Print command on the File menu allows printing of the document using Ghostscript. A Printer Setup dialog box allows selection of the Ghostscript printer driver and resolution, the page range and the Spooler output.

All pages, individual pages or any combination may be printed. The All, Odd and Even buttons provide quick selection of pages.

The mswinpr2 printer driver uses the windows printer drivers and should work with any printer with raster capabilities. Printer resolution cannot be selected from within GSview; use the Control Panel instead.  The Windows printer driver used must be set to Portrait orientation.

With all other printer drivers, Ghostscript sends the output direct to the printer, without passing through a Windows printer driver. If you have trouble printing you may have to Print To File and then Print File or use the DOS command COPY /B FILENAME PRN.

The Win32 versions of GSview and Ghostscript can't send output directly to a printer port so an attempt is made to pass the output unchanged through a Windows printer driver.  This does not work with some Windows printer drivers.  Use 'Print To File' if you have problems.

This list of available devices and resolutions is stored in the [Devices] section of gsview32.ini The default list of devices and resolutions is taken from the standard distribution version of Ghostscript 3.33 and may not be complete.

To print a document without displaying it, open the document using Select File.

Print To File is similar to the Print command except that Ghostscript will write the output to a file instead of sending it to a printer.

If you want to produce a bitmap, some useful drivers are bmpmono, bmp16, bmp16m and bmp256.

Print File sends a file to a local port, bypassing the Windows printer drivers. This is useful for sending a document to a PostScript printer, or for sending an output file produced by Ghostscript to a printer.

Spooler

Properties


Spooler

The Select Printer Port or Select Printer dialog box prompts you for the name of a printer queue or port to which output should be sent. This queue or port will be saved and will be the default selection next time.

Under Windows 3.1, a port name is used.  Output will be spooled for this port.

Under Windows 3.1 / Win32s, a port name is used.  Output will be written directly to this port.  The spooler is not used.

Under Windows 95 or NT, a printer queue name is used. At present this must be a local queue.

See also Print


Properties

The Printer Setup dialog box has a Properties button which allows some printer drivers to configure extra properties and a page offset to be specified.

A page offset can be specified for each printer. The page offset is useful for correcting a mismatch between the page origin of a Ghostscript printer device and a particular printer. Increasing the X value will translate the image towards the right. Increasing the Y value will translate the image downwards.

Properties are typically used to set BitsPerPixel for a colour printer or other types of colour or density correction.

Properties are specific to a particular printer.  Changing the value of the BitsPerPixel property on one printer does not change it for any other printer.

When you press the OK button in the Properties dialog box, the current settings are written to the gsview32.ini file.

Some Properties are predefined in GSview, but these may not match those available in Ghostscript.  The Edit and New buttons allow you to modify available Properties for that printer. See the Edit Properties topic for more details.

Edit Properties


Edit Properties

Not every printer supports the use of optional Properties.  To find out which printers support Properties and which Properties are recognised by each printer, read the Ghostscript file devices.txt or look at the Ghostscript source code.

There are two ways to add or edit Properties.

The first method uses the Edit or New button on the Properties dialog box.

Each property must be either a number or a string.  Number properties are equivalent to the Ghostscript -d command line option.  String properties are equivalent to the Ghostscript -s command line option. Each property consists of a Name and Value.  These are used as -dNAME=VALUE or -sNAME=VALUE. The Value is chosen from the comma separated list of Values entered into the Edit Properties dialog box.  Spaces must not be embedded in the Name or Values.

To delete a property, select it on the Properties dialog box, then press Edit, then press the Delete button on the Edit Properties dialog box.

The second method is to manually edit the GSview INI file.

For each printer, you must add two sections to the gsview32.ini file. The following example shows how to add property information for the cdjcolor driver. First add a section which gives the current values. This section, after the first character is removed, gives the options that will appear in the Property list box. The first character is s for string or d for number.

 [cdjcolor]

 dBitsPerPixel=24

 dDepletion=1

 dShingling=2

 dBlackCorrect=4

Next add a section which gives the values to display in the Value list box.

 [cdjcolor values]

 dBitsPerPixel=1,3,8,16,24

 dDepletion=1,2,3

 dShingling=0,1,2

 dBlackCorrect=0,1,2,3,4,5,6,7,8,9

GSview will also add the value [Not defined] to the listbox.

When GSview prints a file, it will give Ghostscript the contents of the [cdjcolor] section of gsview32.ini as follows:

 -dBitsPerPixel=24 -dDepletion=1 -dShingling=2 -dBlackCorrect=4

If the value of a property is [Not defined], that property will not be sent to Ghostscript.


Text Extract and Find

In general, extracting text from a PostScript document is not a trivial operation.  Words may be broken.  Text may be encoded. Ligatures may be used (e.g replacing 'fi' with a single character). There may be no relationship between the location of a word in the PostScript file and its location on the page. Success in extracting text from a PostScript document depends greatly on the document itself.

GSview has two methods of extracting text from a PostScript file.

The quick method extracts all text from PostScript strings.

The slow method uses pstotext and Ghostscript to more accurately extract text from a PostScript document.

The method used is selected by Options | Quick Text. See the appropriate topic below:

Quick Text Extract and Find

Slow Text Extract and Find


Quick Text Extract and Find

It is common for PostScript documents to contain text in the same order as it appears on the page, and for it to be given in PostScript strings, surrounded by parentheses.  Complete lines may be given in one string, or one word per string.  For this sort of document, extracting text can be done with reasonable success.

Edit | Text Extract will extract text contained in strings from specified pages and write it to a text file. Line breaks in this text file correspond to lines in the document. Spaces in the text file correspond to spaces within strings, or to separate strings.  A more effective method of extracting text is to use ps2ascii.ps supplied with Ghostscript, or to use the pstotext program listed on the Ghostscript WWW page.  pstotext can be used from GSview by unchecking Options | Quick Text.

Edit | Find will search for text and display the first page that contains the text.  Find asks for a search text and a range of pages in which to search. The preceeding comments about extracting text from a PostScript document should be noted.  Find first extracts text from the document, then searches it ignoring all spaces in both the document and the search text.  Case is ignored when searching. Consequently the search text these would match both These and The serial.  No information is given about where the word is located on a given page because this information is not available without a complete PostScript interpreter. Find will not work for non DSC documents or DSC documents with special page order.

Edit | Find Next will continue the search from the next page.


Slow Text Extract and Find

This method uses pstotext and Ghostscript to extract text from a PostScript document.  Before doing any text extraction or searching, the entire PostScript document will be processed by Ghostscript and pstotext to produce a text index file. This may take a long time.  Once this has finished, text extraction and searching should be quick.

Orientation must be set to match the text direction of the document.

Edit | Text Extract will extract text from specified pages and write it to a text file.

Words can be copied to the clipboard using Edit | Copy.

Edit | Find will search for text and display the first page that contains the text.  Find asks for a search text and a range of pages in which to search. The search text is first broken up into words.  For each search word, a search is made to find a match anywhere within a document word. Searching for frog would find frog, frogs and bullfrogs. The wildcards '*' (zero or more characters) and '?' (any one character) are supported, but it doesn't make sense to use them at the beginning or end of a word. Wildcards do not extend beyond the word being searched. Multiple complete words may be specified, e.g.  GSview is a. If the search text is found, the page containing the text is displayed and the first word highlighted. Find will not work for non DSC documents or DSC documents with special page order.

Edit | Find Next will continue the search.


Clipboard

The GSview window can be copied to the Clipboard as a bitmap by selecting Copy from the Edit menu. The bitmap will be a Device Independent Bitmap (DIB/BMP format).

An alternative way to get a bitmap output from Ghostscript is to use one of the BMP drivers.  See Print.

Paste To copies a Device Independent Bitmap from the Clipboard (if available) to a BMP file.

Convert Bitmap converts between a Device Independent Bitmap and a Device Dependent Bitmap. If the clipboard contains a Device Independent Bitmap (BMP format), this is converted to a Device Dependent Bitmap and added to the clipboard. If the clipboard does not contain a colour palette, one is created from the Device Independent Bitmap and added to the clipboard. This option is present because some applications (notably Windows Paintbrush) won't recognise a Device Independent Bitmap in the clipboard.

If Slow Text Extract and Find is used on a document, GSview creates an index of the words in the document.  If any words are marked with the mouse, Copy will copy these words to the clipboard instead of copying a bitmap.  Text cannot be marked until either Text Extract or Find has been used with Option | Quick Text unchecked.


EPS Preview

Add EPS Preview takes a bitmap from the display and uses it to add a preview to an EPS file. Add EPS Preview can create a DOS EPS file with a Windows Metafile or TIFF preview, or an EPSI file with an Interchange preview. To use the Add EPS Preview command the following steps must be followed.

1. Deselect Options | Ignore DSC

2. Make sure the document has a correct bounding box. A bounding box can be added or changed using File | PS to EPS.

3. Select Orientation | Portrait.

4. Select Options | EPS Clip. This will cause Ghostscript to use a display window the size of the bounding box instead of the page size.

5. Select Media | Display Settings and set a suitable resolution for the preview.  If the resolution is too high it will make the EPS file excessively large.

6. Open an EPS file that does not contain a preview.

7. Select Edit | Add EPS Preview, then the preview format, then the new EPS filename.  GSview will write a new file containing the original PostScript EPS file and a preview created from the display bitmap. The available preview formats are Interchange, TIFF 4, TIFF 5 and Windows Metafile. If adding an Interchange preview, the document must have an %%EndComments line, otherwise GSview may put the preview in the wrong place. A TIFF 5 preview is a Class B image with no compression as described in Appendix G of the TIFF 5.0 memorandum.  A TIFF 4 preview is almost identical to the TIFF 5 preview, but avoids using tags which are not described in the TIFF 4 specifiation. WordPerfect 5.1 requires a TIFF 4 preview. A Windows Metafile preview contains a bitmap.

8. Reset Orientation | Portrait, Options | EPS Clip and Media | Display Settings to their previous values.

To extract the PostScript or Preview section from a DOS EPS file, use File | Select File followed by Edit | Extract EPS then PostScript or Preview.

See also PS to EPS.

User Supplied Preview


User Supplied Preview

The Edit | Add EPS Preview | User Supplied Preview command allows an existing TIFF or WMF file to be added to an EPS file to create a DOS EPS file. This is useful if an application can export to an EPS file and to a WMF file, but cannot create a DOS EPS file with a WMF preview. The EPS file must contain a bounding box that corresponds with the TIFF or WMF preview file. It is not necessary to display the EPS file. User Supplied Preview can be used after an EPS file has been opened with Select File.

You can add a preview that has no resemblance to the Postscript, which is most undesirable.


Options

The Options menu has the following selections:

Configure Ghostscript

Sounds

Units

Save Settings

Safer

Save Last Directory

Button Bar

Fit Window To Page

Quick Open

Quick Text

Auto Redisplay

EPS Clip

EPS Warn

Ignore DSC

Show Bounding Box


Configure Ghostscript

Ghostscipt DLL tells GSview where to find Ghostscript. The default is c:\gstools\gsN.NN\gsdll2.dll for OS/2, and c:\gstools\gsN.NN\gsdll32.dll for Win32.

Enter the correct Ghostscript include path into the Ghostscript Include Path field. This include path must include the directories where the Ghostscript library files (gs_*.ps and Fontmap) and the Ghostscript fonts (*.pfb) are located.

  c:\gstools\gsN.NN;c:\gstools\gsN.NN\fonts

Do NOT put a -I before the include path.

It is usual to leave tlhe Ghostscript Options field empty. If you wish to turn off the Platform Fonts feature under MS-Windows, put -dNOPLATFONTS in the Ghostscript Options field.

See the Installation topic.


Sounds

The Sounds option assigns sounds to various events. For each event the sound can be set to None, a Speaker Beep or a Wave file.

You must have a sound driver loaded before using Wave files. Wave file sounds are not available under MS-Windows 3.0.

The events are:

Output Page: the PostScript showpage operator was executed.

No Page: an invalid page was selected. For example, pressing Prev while on the first page of a document with DSC comments.

No Number: a command required page numbering and the document did not have page numbering. For example, pressing Goto Page when viewing a document without DSC comments.

Not Open:  a command required a document to be open and this was not the case. For example, pressing Goto Page when no document is open.

Error: many types of errors.

Start: GSview opened.

Exit: GSview closed.

Busy: busy at the moment, can't do what you asked.

The defaults are for No Page, Error and Busy to be a  Speaker Beep and all other events to be None.


Units

The Units option sets the units used to display the cursor location on the status bar.  Available units are PostScript points (pt = 1/72"), millimetres (mm) and inches (in). The default is pt.


Save Settings

The Save Settings Now option saves the GSview window position, window size, last used printer, last directory, all items on the Options menu and all items on the Media menu to the initialisation file gsview32.ini in the Windows system directory. GSview reads this file during startup.

When the Save Settings on Exit option is checked, GSview will automatically save the above settings when you quit GSview.


Safer

When the Safer option is checked, GSview will give Ghostscript the -dSAFER flag, which disables the deletefile and renamefile operators, and the ability to open files in any mode other than read-only. This is the default.

When the Safer option is unchecked Ghostscript can change files.


Save Last Directory

When the Save Last Directory option is checked, GSview will save the current directory when you quit GSview.  When GSview is started next, this will be made the current directory. This is the default.

When Save Last Directory option is unchecked, the current directory when GSview is started will be the directory where GSview is located, or the working directory specified by the Program Manager.


Button Bar

When the Button Bar option is checked, GSview will display a Button Bar down the left side of the window.  This is the default. The Button Bar contains the following items in order from top to bottom:

 File | Open

 File | Print

 File | Info

 Help | Contents

 View | Goto Page

 View | Next Page

 View | Previous Page

 Go forward 5 pages

 Go back 5 pages

 Increase resolution by 1.2

 Decrease resolution by 1/1.2

 Edit | Find

 Edit | Find Next

If using the increase/decrease resolution buttons, Auto Redisplay should be set.  Instead of using these buttons the Media | Display Settings command can be used. When the Button Bar option is unchecked, GSview will not display the Button Bar.


Fit Window To Page

When the Fit Window To Page option is checked, GSview will shrink the window size so that it is no larger than the page being displayed.  This is the default. Window shrinking will only occur when the window is resized; it does not happen immediately after this option is changed. Fit Window To Page is ignored for a maximized window.

If Fit Window To Page is unchecked, GSview will not resize the window and areas outside the page will be drawn in light grey. This is useful if you do not wish the window to shrink when looking at pages at low resolution.


Quick Open

When the Quick Open option is checked, GSview will not restart Ghostscript whenever the page orientation, resolution or size is changed.

GSview tries to preserve the Ghostscript state, but a document may still leave the Ghostscript interpreter in an unusual state or cause an error.  If an error occurs, Ghostscript will abort. Ghostscript error messages are displayed using File  | Show Messages. Select Redisplay to reopen the document.

If Quick Open is unchecked, GSview will restart Ghostscript before each new document or whenever the page orientation, resolution or size is changed.


Quick Text

GSview has two methods of extracting and searching text.

The Quick Text Extract and Find method does a simple extraction of PostScript strings.  This method is easily confused.

The Slow Text Extract and Find method uses the external pstotext tool and Ghostscript to extract words and their coordinates. This method is more accurate, but there may be a long pause while pstotext and Ghostscript do the initial processing. After this, text extraction and searching should be quick.

The default for Quick Text is unchecked (slow).


Auto Redisplay

When the Auto Redisplay option is checked, GSview will redisplay DSC documents when the Orientation, Resolution, Depth or Media are changed. This is the default.

For non-DSC documents, if Auto Redisplay is checked, GSview will restart at the first page.

If Auto Redisplay is unchecked, the View | Redisplay command must be used to redisplay a document after changing the Orientation, Resolution, Depth or Media.


EPS Clip

When the EPS Clip option is checked, GSview will clip the display bitmap to the bounding box of an EPS file instead of using the page size specified on the Media menu.  This is useful when adding a bitmap preview to an EPS file.

If EPS Clip is unchecked, GSview will use the page size specified on the Media menu for EPS files.  This is the default.

EPS Clip does not alter the original document, it only affects how much of the document is displayed by GSview.

See also Edit | Add EPS Preview


EPS Warn

When the EPS Warn option is checked, GSview will write a prolog to Ghostscript when each file is opened.  This prolog will produce warning messages in the File | Show Messages window if any PostScript operators that should not be used in EPS files are used.  An example warning message is:

 Warning: EPS files must not use /initgraphics

EPS Warn is not infallible.  It is possible to access restricted operators without EPS Warn producing a warning. If you do get a warning, do NOT used PS to EPS.

The default for EPS Warn is unchecked.

See also PS to EPS.


Ignore DSC

Some documents incorrectly claim to conform to the Adobe Document Structuring Conventions.  Attempting to display one of these bogus documents will probably leave GSview horribly confused and unable to display the document.  If Ignore DSC is checked, GSview will treat the document as if it does not contain DSC comments and will only display the pages in the original order.

The default for Ignore DSC is unchecked.


Show Bounding Box

Selecting this option causes a dashed rectangle to drawn over the image, showing the location of the bounding box. This bounding box is only drawn on the display, and does not affect printer output. The bounding box will only be shown for DSC documents (non conforming documents don't have a bounding box).

The default for Show Bounding Box is unchecked.


Page Orientation

The Portrait, Landscape, Upside-down and Seascape (reverse Landscape) commands on the Orientation Menu select the page orientation used by the display. Landscape implies a clockwise rotation of the paper by 90 degrees. Seascape implies an anti-clockwise rotation of the paper by 90 degrees. These orientation options only affect the display and do not affect the print commands. If a DSC page orientation comment is found (%%Orientation), the orientation will be selected automatically.

When the Swap Landscape option is checked, GSview swaps the meaning of Landscape and Seascape. Most of the Landscape documents that I have encountered require a 90 clockwise rotation of the paper to view. However, there is no standard and some documents need to be rotated the other way. The Swap Landscape button allows GSview to automatically rotate the document the right way in response to the %%Orientation comment in the PostScript file.

See also Page Size and Display Settings.


Display Settings

These settings only affect the display.

The Resolution field sets the display resolution in dots per inch. The default for a VGA display is 96 dots per inch. This can also be changed by the resolution changing buttons on the button bar.

For DSC conforming files, pressing the right mouse button will zoom into the page at what is usually printer resolution. Pressing the right mouse button a second time will zoom back out to normal display resolution. The Zoom Resolution field sets the zoom resolution in dots per inch.

The Depth field sets the page bitmap depth in bits per pixels for the display. Default will select the highest depth supported by your display driver.  In general, you shouldn't set this higher than your actual display depth because doing so will use extra memory for the page bitmap but won't improve the display.

The Text Alpha field sets anti-aliasing for fonts.  The default (no anti-aliasing) is 1 bit.  To enable anti-aliasing of fonts, use 2 bits or 4 bits.

IMPORTANT: If you use Text Alpha, GSview will disable Platform Fonts by doing the equivalent of adding

  -dNOPLATFONTS

to the Options | Configure Ghostscript Ghostscript Options field.

The Graphics Alpha field sets anti-aliasing for graphics and also for text that is too large to fit in the font cache.

Using anti-aliasing slows down drawing. Text and Graphics Alpha can only be used if your display depth is set to 8bits/pixel or higher.


Page Size

The Media menu also allows selection of page size. Available page sizes are:

 Letter          8.5 x 11   inch

 Tabloid        11   x 17   inch

 Ledger         17   x 11   inch

 Legal           8.5 x 14   inch

 Statement       5.5 x  8.5 inch

 Executive       7.5 x 10   inch

 A3              297 x 420  mm

 A4              210 x 297  mm

 A5              148 x 210  mm

 B4              257 x 364  mm

 B5              182 x 257  mm

 Folio           8.5 x 13   inch

 Quarto          8.5 x 10.8 inch

 10x14          10   x 14   inch

A user defined size can be specified in PostScript points (1/72 inch) with the User Defined command.  A size of 480x360 points at 96 dpi will give an image size of 640x480 pixels.

If a DSC media comment is found, such as

 %%DocumentPaperSizes: a4

 %%DocumentMedia: a4 595 842 80 white ( )

the page type will be selected automatically. If the media specification is not one of the above page types, the User Defined size will be set.


Keys

Following are the key assignments for GSview.

O, o  Open and display a file.  (File | Open)

C, c  Close file.  (File | Close)

N, n, +  Next Page.  (View | Next Page)

Space     Next Page and Home.  (View | Next Page and Home)

V, v, -  Previous Page.  (View | Previous Page)

BackSpace  Previous Page and Home.  (View | Previous Page and Home)

G, g  Goto Page.  (View | Goto Page)

I, i  File information.  (File | Info)

R, r  Redisplay page.  (View | Redisplay)

S, s  Select file: open but don't display.  (File | Select File)

A, a  Save As. (File | Save As)

P, p  Print all or some pages to a printer.  (File | Print)

F, f  Print all or some pages to a File.  (File | Print) with

  `Print to File` checked.

E, e  Extract some pages to another File.  (File | Extract)

M, m  Show Ghostscript Messages.  (File | Show Messages)

< Decrease resolution by 1/1.2

> Increase resolution by 1.2

F1  Help.  (Help | Contents)

Ctrl+C, Insert  Copy displayed bitmap to clipboard.  (Edit | Copy)

Ctrl+F, Find Text. (Edit | Find)

F3, Find Next. (Edit | Find Next)

Up  Scroll up 16 pixels.

Down  Scroll down 16 pixels.

Left  Scroll left one screen.

Right  Scroll right one screen.

Page Up  Scroll up one screen (window height).

Page Down  Scroll down one screen.

Home  Scroll to top of page.

End  Scroll to bottom of page.


Running GSview from the File Manager or Windows Explorer

If you used the GSview setup.exe program and answered yes to all the questions, the following configuration has already occured. If you didn't update the registry during GSview installation, the following information explains how to do it manually.

To run GSview when a PostScript file is double clicked in the File Manager, the following sequence must be followed to teach File Manager about PostScript files.

From the Program Manager, run the Registration Info Editor using File | Run... then type regedit. From the Registration Info Editor select Edit | Add File Type... then enter the following fields:

 Identifier = psfile

 Filetype = PostScript

 Action = Open

 Command = c:\gstools\gsview\gsview32 %1

 Uses DDE = unchecked

 Action = Print

 Command = c:\gstools\gsview\gsview32 /p %1

 Uses DDE = unchecked

Then press OK.

From the File Manager, select File | Associate then enter the following fields:

 Files with Extension = ps

 Associate With = PostScript (gsview)

Then press OK.

That's it!  Now when you double click on a PostScript file, the File Manager will run GSview.  When you drop a PostScript file on the Print Manager, GSview will print the file. If you have a PostScript printer, this won't be useful. In this case you will need to remove the Print action from the registry.

For Windows 95, the configuration is instead made using Windows Explorer.

Start Windows Explorer.  Select View | Options .  Select the File Types tab.  Select the New Type button. Enter the following fields:

 Description of type = PostScript

 Associated Extension = PS EPS

Press the New button, then enter

 Action = open

 Application used to perform action = c:\gstools\gsview\gsview32.exe

Press the OK button

Press the New button, then enter

 Action = print

 Application used to perform action = c:\gstools\gsview\gsview32.exe /p

Press the OK button

Press the Close button.

Press the Close button.


Command line options

Usage:

 gsview32 [/D] [Tn] filename

 gsview32 [/D] [Tn] /F filename

 gsview32 [/D] [Tn] /P filename

 gsview32 [/D] [Tn] /S[port] filename

To start GSview and display filename.ps use:

 gsview32 filename.ps

To start GSview and print filename.ps using Ghostscript (File | Print) use:

 gsview32 /P filename.ps

To start GSview and print filename.ps to a file using Ghostscript (File | Print To File) use:

 gsview32 /F filename.ps

To start GSview and spool filename.ps for printing directly to a printer (File | Print File) use:

 gsview32 /S filename.ps

To start GSview and spool filename.ps for printing directly to printer port LPT3: use:

 gsview32 /SLPT3: filename.ps

To start GSview in debug mode use:

 gsview32 /D

In debug mode GSview will not remove its temporary files. This is to allow inspection of these files after GSview has finished. Debug mode also produces more verbose output for File | Show Messages.

GSview by default runs multi-threaded under Windows 95 and Windows NT, and single-threaded under Windows 3.1 / Win32s. To change this, use /T to toggle the threading mode, use /T0 to select single-thread mode and /T1 to select multi-thread mode.

GSview ignores the case of options: /p is the same as /P.


World Wide Web

The World Wide Web home page for Ghostscript, Ghostview and GSview is at

 http://www.cs.wisc.edu/~ghost/

GSview can be used as a PostScript file viewer for several OS/2 and MS-Windows Web browsers.  See the GSview home page for details.


Copyright

The About menu item shows the GSview copyright message and GSview version number.

 GSVIEW.EXE - A Ghostscript graphical interface

 Copyright (C) 1993-1996, Russell Lang.  All rights reserved.

 Portions Copyright (C) 1994, Timothy O. Theisen.  All rights reserved.

This file is part of GSview.

This program is distributed with NO WARRANTY OF ANY KIND.  No author or distributor accepts any responsibility for the consequences of using it, or for whether it serves any particular purpose or works at all, unless he or she says so in writing.  Refer to the GSview Free Public Licence (the "Licence") for full details.

Every copy of GSview must include a copy of the Licence, normally in a plain ASCII text file named LICENCE.  The Licence grants you the right to copy, modify and redistribute GSview, but only under certain conditions described in the Licence.  Among other things, the Licence requires that the copyright notice and this notice be preserved on all copies.

    Author: Russell Lang

  Internet: rjl@aladdin.com

(This is an alias provided by Aladdin Enterprises.  Russell Lang is not an employee or agent of Aladdin Enterprises). Please read the Common Problems topic, the GSview README.TXT and browse the WWW page before sending mail to the author.

GSview uses pstotext in an external DLL. pstotext was written by Andrew Birrell and Paul McJones.  It is

  Copyright (C) 1995-1996, Digital Equipment Corporation.

See the licence in pstotext.txt or pstotext.zip for more details. If you do not agree to the pstotext licence, delete pstotext.zip, pstotxt2.dll and pstotxt3.dll.


Common Problems

Problem: Can't load Ghostscript DLL ...

GSview requires the Ghostscript DLL (gsdll2.dll for OS/2, gsdll32.dll for Win32). This error message usually occurs if you don't have Ghostscript, or if GSview can't find Ghostscript.

From the GSview menu select Options | Configure Ghostscript and enter the correct Ghostscript DLL path. For example

 c:\gstools\gsN.NN\gsdll32.exe

This message also occurs if Ghostscript cannot find its initialization files (e.g. gs_init.ps).  Set the Ghostscript Include Path correctly.

If using Win32s, make sure you don't already have a copy of the Ghostscript DLL loaded by another copy of GSview. Only one copy of Ghostscript DLL can be loaded by Win32s at a time.

If you can't get GSview to run Ghostscript DLL correctly, make sure you can configure and run Ghostscript on its own.

Problem: Ghostscript Messages window says Can't find initialization file gs_init.ps.

Set the Ghostscript Include Path to point to the directory containing the correct gs_init.ps.

Problem: Ghostscript Messages window says gs: Interpreter revision (XXX) does not match gs_init.ps revision (YYY).

Set the Ghostscript Include Path to point to the directory containing the correct gs_init.ps. Don't try to display a PostScript file in the directory of an old version of Ghostscript (which will cause the old gs_init.ps to be loaded irrespective of the Ghostscript Include Path).

Problem: Ghostscript Messages window says Wrong version of DLL found.  Found version XXX  Need version YYY.

GSview found the wrong Ghostscript DLL.  Install the required version of the Ghostscript DLL.  Make sure you have only one copy of the Ghostscript DLL on your system.

Problem: GSview says that a multipage PostScript file produced by MS-Windows contains 0 pages and will only show the first page.

This is because the document does not have correct DSC comments. From the Control Panel, select Printers, Options..., then in the Print to group box click on the Printer radio button.  You cannot use the Print To Encapsulated PostScript File for printing multipage files.  The correct method is to connect the printer to FILE:. In addition, from the Control Panel select Printers, Options..., Advanced and then check Conform to Adobe Document Structuring Convention.

The DSC comment %%Pages: 0 means that the document does not produce any pages.  That is, the PostScript showpage operator is not used. If you find a PostScript document that has multiple pages and contains the %%Pages: 0 comment, change the first line from %!PS-Adobe- to %!. GSview will then ignore the DSC comments and allow you to view all pages, but only in the original order.  Complain to the author of the program that produced that PostScript file.

Some PostScript printer drivers include code that is specific to a particular printer.  The PostScript output from these drivers may be unportable and may not display in GSview.  If you are having this problem, try using a reasonably generic PostScript driver such as Apple LaserWriter II NT for PostScript level 2 printers, or Apple LaserWriter Plus for PostScript level 1 printers.

For Windows 95, open the printer properties then select the PostScript tab, then select PostScript Output Format = PostScript (optimize for portability - ADSC).

Problem: GSview says "Page ordering is Special.  Can't reorder pages."

Your document used the DSC comment %%PageOrder: Special which means that pages can not be reliably reordered.  This prevents GSview from displaying pages in any order other than the original order.

By default, Windows 95 creates PostScript files which use special page ordering.  To disable this, open the printer properties then select the PostScript tab, then select PostScript Output Format = PostScript (optimize for portability - ADSC).

Problem: PostScript files produced by MS-Windows start with a Control-D.

For Windows 3.1:

Since this occurs even when the PostScript printer Conform to Document Structuring Convention checkbox is checked, this must be considered a bug in the MS-Windows PostScript printer driver. The bug fix is documented in the MS-Windows PRINTERS.WRI file. Edit the win.ini file and search for the PostScript printer section. There may be more than one.  In each of these sections add CTRLD=0 as shown below.

 [Apple LaserWriter II NT,FILE]

 CTRLD=0

For Windows 95:

The PostScript printer driver setup has an option (Properties, PostScript, Advanced) for suppressing a ^D at the start of a document. Fortunately the default is do not send ^D before job.

Problem: PostScript files produced by Word for Windows 6.0 cause a "Missing %%Pages comment" message box.

Congratulations.  You have just found a mistake in the DSC comments when Word included an EPS file.  Word should have surrounded the included EPS file with the lines

 %%BeginDocument: filename.eps

 %%EndDocument

Because Word didn't do this, GSview can't tell how many pages are in the document and where they are located.

Please complain to Microsoft.  There is a problem in the EPSIMP.FLT filter version 2.01 which Microsoft needs to fix.

In the interim, you have two solutions:

1. Select Options | Ignore DSC

2. Edit the PostScript file to correct the DSC comments. Search the PostScript file for all lines containing

  %MSEPS Preamble

From each of these lines, search forward for the start of the included EPS file which should start with a line like

 %!PS-Adobe-3.0 EPSF-3.0

Above these lines add the line

 %%BeginDocument: AddedByHand

Then search for all lines containing

 %MSEPS Trailer

Above these lines add the line

 %%EndDocument

GSview should then be able to display the file correctly.


Other Help Topics

These topics are usually accessed by pressing the Help button on a dialog box.

Show Messages


Show Messages

GSview uses Ghostscript to display or print PostScript files. Show Messages displays the console output from Ghostscript, and is most useful when a PostScript error occurs.

The text in the Show Messages window can be copied to the clipboard. If no text is selected, the entire text will be copied to the clipboard. If some text is highlighted, only that text will be copied to the clipboard.

Explanations of some of the error message that may appear in the Show Messages are given in the Common Problems topic.


Internals

GSview uses the Aladdin Ghostscript DLL to render PostScript files.

Under Win32s, the GS DLL can be used by only one application at a time.  Under Windows 95, Windows NT and OS/2, the GS DLL can be used by many applications at a time (provided you have enough memory). When using Win32s, GSview must unload the GS DLL while it is being used by gvwgs.exe for printing.

gsv16spl.exe is a 16 bit Windows application used by GSview to spool files from GSview Win32s.  gsv16spl can not be used on its own - it must be started by GSview.  It is not used by Windows 95 or NT.

gvwgs.exe (Windows) and gvpgs.exe (OS/2) are GS DLL loaders for printing.  It would be possible to use them from the command line, but since they delete the files listed on the command line it would be safer to use gswin32.exe (Win32), gswin32c.exe (Win32 console) or gsos2.exe (OS/2).