SLAC 18 April 1995
VIEWEPS is a tool that enables collections of encapsulated Postscript (eps)
files to be made available on the web. It provides facilities for:
- Creating thumbnail GIF images from the eps files
- Automatic translation of eps files into plain postscript, GIF or JPEG,
at the request of the user.
- Facilities for users to request hard copy (print) versions of eps files.
This facility is used to make several collections of eps figures available at
Setting up an image archive
ViewEPS requires that the directories containing an EPS archive be set up in a
stylized fashion, as illustrated below:
Each archive can contain an arbitrary number of eps collections (e.g.
collection1, collection2 in the above diagram). Within each collection one
directory (named eps) must contain the source eps files, and a second
directory (named thumbnail) must contain the thumbnail images created from the
eps files. Configuration files can be placed in each collection directory,
and will override the default configuration files set up by the maintainer of
vieweps. The configuration files can be used to control which printers will
appear in the list of printers, and to control the text that will appear at the
top and bottom of each page generated by vieweps.
Each eps archive requires an entry in the web server configuration file. For
the above archive the line would be of the form:
Map /a/b/c/figure/* /cgi-bin/vieweps/*
Creating Thumbnail Images
To create the thumbnail images from the eps images, cd to the directory
containing the eps files, and issue the command:
(At SLAC the tna files lives in /usr/local/www/bin,
so you will need to make
sure that directory is included in your unix PATH).
Any time you change one of the eps files, or add a new one, reissue the above
command, and it will process only those files that have changed since it was
last run. If for any reason you want to regenerate all of the thumbnail images
just issue the commands:
Setting up configuration files
The VIEWEPS package reads several configuration files which control its
oepration. You can override any of the default configuration files for a
particluar eps collection by placing
a modified copy of the relevant configuration file in the root directory for
the collection (e.g. /a/b/c/figure/collection1 in the above diagram).
See the documentation below for details of the
Describing the files
By default the list of eps files for a particular collection will show
the name of each file in the collection. You can add a more explicit
description of each file by creating a file called index in the
root directory of a collection
(see example). This file should contain
one line for each eps file. Each line contains two colon delimited fields,
- The name of the eps file (without the trailing .eps)
- The description of the file, which may include HTML markup.
The VIEWEPS package consists of the following files:
In addition you will need the epsfix utility written by
as well as ghostscript and various parts of the pbmplus package. To
create JPEG images you will also need the cjpeg utility from the Independent
- A cgi script which must be installed in the cgi-bin directory of your web
server. This is a perl script which produces the web pages seen by vieweps
- A simple script which is used to generate the thumbnail images. At SLAC
this is kept in /usr/local/www/bin
- A script which is used by tna. At SLAC
this is kept in /usr/local/www/bin
- Controls what printers postscript can be sent to
(See example). The file contains
one line per printer. Each line contains three colon delimited fields. These
fields should contain:
- The printer name
- The command to be used to print the document. This command should expect to
read the postscript to be printed as STDIN and generate any error messages on
- A description of the printer. May contain HTML markup.
- Text to appear before the list of eps files.
- Text to appear after the list of eps files.
- Text to appear after the list of formats for a specific eps image.
- Text to appear after the list of printers.
- Text to appear after a file has been printed.
The source code
Is available here.