ps2www

A tool for publishing Postscript documents on the web

Brief Description:

ps2www is a Perl script that uses ghostscript and the netpbm tools to publish your Postscript documents in Postscript, PDF, and GIF formats. HTML pages are created to link to and present each format. Here is an example.

Author:

David Anderson

Downloading:

ps2www freely available and you are encouraged to distribute it but do not offer it for sale or modify it without notifying me. Please give me any suggestions you may have for improving ps2www. I will gladly incorporate your improvements (if I can) and give you credit.

To save ps2www to your disk you may need to click on the following link with the right mouse button and select save link as, or whatever the equivalent is for your browser.

ps2www

Installation:

To install ps2www simply save the script, change its permissions to make it executable and place it in your path.

You will need to have Perl, Aladdin Ghostscript version 4.x or later (preferably version 5.10), and the netpbm tools installed on your system to use ps2www. These are usually installed on Unix systems but the version of Ghostscript is often older and will need to be updated. (This is because Unix systems are usually distributed with the GNU licensed version and not the Aladdin version.) Older versions of Ghostscript will not handle as many Postscript documents and the quality of the GIF files is much poorer because it does not perform anti-aliasing on the fonts.

Documentation:

The basic method of invoking ps2www to publish myfile.ps on the web is as follows:

ps2www myfile "The title for the html document"

This will create the following:

myfile.html This is the file that you should link to. It is a wrapper files containing links to each version of the document
myfile.pdf This is created by ps2www only if it does not already exist. This is because the PDF files created by Ghostscript do not have any compression so if you create one using Adobe Acrobat then we do not want to overwrite it. You can force the creation of myfile.pdf with the -p command-line option.
myfile_n.html Created to display the GIF image of the nth page.
myfile_n.gif A GIF image of the nth page.

The following command line options affect the behavior of ps2www:

-l
Landscape mode. Use this option for Postscript files which should be displayed in landscape mode. Note, the PDF file will not be generated because I don't know how to force Ghostscript to output a file in landscape.
-s
Seascape mode. This is just like landscape except the paper is rotated 90 degrees counter-clockwise instead of clockwise.
-p
Force the creation of a PDF document. This is used to overwrite an existing PDF file.
-c
Crop extra white-space around all edges.
-d dir
Destination directory. All files will be placed in the named directory (which is created if necessary) and the Postscript file is also copied to this directory.
-t dir
Temp directory. The intermediate files created by ps2www may be huge. Usually these files are created in the current directory and then deleted, this option may be used to specify another directory for the intermediate files.
To Do:

I intend to add some switches allowing you to specify HTML code to be inserted.

Miscellaneous:

This is my first Perl program so I can't warrantee it in any way. It has worked well for those of us who have used it in conjunction with the Computer Enhanced Education project at Georgia Tech but I can't promise that it will work in any given situation.

Also, Adobe, Acrobat, and Postscript are trademarks of Adobe Systems Incorporated.

Click here to return to David's Homepage.

You are visitor # since 5/5/98.