Webify: Some notes and hints

Herein are notes regarding installation and running of webify, obtaining Ghostscript, Macintosh-specific issues, bugs , and a summary of recent changes.

Installing Webify

Webify runs only on UNIX systems, although it should be a simple port to other platforms supporting Ghostscript.

Obtaining Ghostscript

Ghostscript version 2.6.1 is distributed under the GNU copyleft terms and is available at prep.ai.mit.edu; you might grab fonts and fixes too. This is the version of Ghostscript of choice, for reasons noted below.

A newer, fancier, and apparently buggier version is distributed by Aladdin under different terms; poke around ftp://ftp.cs.wisc.edu:/pub/ghost/aladdin/ and you'll find version 3.12 along with fonts, fixes, and information.


BUGS: Ghostscript 3.12 seems to crash when given certain postscript files containing bitmap images, including the version of webifydoc.ps contained in earlier webify distributions. This led to a number of bug reports from users who couldn't build the example webify presentation using the newer gs version. This bug still exists in gs 3.12; it has been circumvented temporarily by elimination of bitmap images from the example presentation. A shorter postscript file which triggers this bug is available; note that the bug is independent of webify, and can be observed simply by viewing the offending file using gs.

In addition, I have been unable to get 3.12 to adjust gif8 device parameters (or those of other devices, for that matter) appropriately; for example, it seems unable to deal with landscape-format postscript files.

Until these problems with gs 3.xx are resolved, you may need to use gs 2.6.1 to webify postscript files, at least Powerpoint-generated postscript files, containing bitmap images. Its possible that there are other workarounds, such as generation of .eps (rather than .ps) files. You can specify an alternative Ghostscript command using the -g command option; for example, "webify -g "old/gs -Iold/ ..." can be used to run an old gs version and load its gs_init.ps file from its own directory.

If anyone takes the trouble to debug these problems, I'd love to hear about it. The Aladdin version of gs has many features that webify might utilize, including generation of JPEG images.


Running Webify

To get summary help on webify, type the command "webify" with no arguments. You'll get something like this.

Before using webify to convert a postscript file, you'll probably want to customize a template for your own use. Edit webify.template; start with minor changes (like changing my name and email address -- at the bottom of the file -- to your own). If you know HTML and have a strong intuition, you'll immediately see how to make substantive changes; otherwise, you may want to make your changes more incrementally. Very little has to be changed to make the sample template useful for a wide variety of purposes.

To run webify on a UNIX system, type the command

       webify <options> template file.ps
which will read specified template file as well as the postscript file.ps, and generate a subdirectory ("named "file") containing a tree of web pages whose root is named "index.html".

Template is a text file containing skeletal HTML, as well as escape sequences enclosed in curly brackets {...}. Click here to see a typical template (the one which generated the sample webify presentation). <options> allow various parameters to be specified in the command line rather than via escapes in the template; this allows a single template to be used for a variety of applications. For a summary of available options, invoke webify with no arguments as described above.

BUG: Under certain circumstances, Ghostscript loops forever when converting a file whose contents extend beyond page boundaries -- eg when you're over-cropping pages. Adjusting the cropping parameters to webify is the only way I know of to get around this problem currently.

Postscript from Macintosh applications

Generation of postscript from the Macintosh is easy using the Laserwriter 8 driver (currently version 8.2; 8.1.1 and earlier are extremely buggy). Select file output from the print dialog, include all fonts (to be safe), and write the postscript file somewhere for convenient transport to the UNIX system running webify.

Idiosyncrasy: The Mac driver inherits some parameters from the selected printer, even when producing postscript files rather than hard copy. For certain printers, the postscript -- hence the gif images -- are upside down. This can be accommodated via the -f command line option to webify, or via the {FlipPage} directive in the template file.

Known Bugs

Change log

Recent changes include:

Thanks to all the users who conveyed bug reports, suggestions, improvements, and encouragement.

Steve Ward ... ward@mit.edu