VIEWEPS documentation
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
SLAC.
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:
tna *.eps
(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:
rm ../thumbnail/*.gif
tna *.eps
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
configuration files.
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,
which contain:
- The name of the eps file (without the trailing .eps)
- The description of the file, which may include HTML markup.
Implementation
The VIEWEPS package consists of the following files:
- vieweps
- 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
users.
- tna
- A simple script which is used to generate the thumbnail images. At SLAC
this is kept in /usr/local/www/bin
- tn
- A script which is used by tna. At SLAC
this is kept in /usr/local/www/bin
In addition you will need the epsfix utility written by
Ray Cowan,
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
JPEG group.
- print.conf
- 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
STDOUT.
- A description of the printer. May contain HTML markup.
- head.html
- Text to appear before the list of eps files.
(See example)
- tail.html
- Text to appear after the list of eps files.
(See example)
- tail2.html
- Text to appear after the list of formats for a specific eps image.
(See example)
- tail3.html
- Text to appear after the list of printers.
(See example)
- tail4.html
- Text to appear after a file has been printed.
(See example)
The source code
Is available here.
TonyJ