Xpdf for OpenVMS/Alpha

With some effort, I've managed to compile Xpdf version 3.02 (the latest as of this writing) for OpenVMS/Alpha. This is an up-to-date PDF viewer (analogous to Adobe Acrobat) for VMS users.

Xpdf requires two shared libraries: T1Lib and Freetype. As of this writing, the latest versions of each are 5.1.1 and 2.3.4, respectively. Xpdf also requires Ghostscript, in order to use the Type 1 fonts that come with it (especially the 13 required PostScript fonts). To make it convenient to install and remove, I have packaged the compiled binaries for all three in PCSI (PolyCenter Software Installation utility) format.

First, if you don't already have it, download and install GhostScript 6.5 (also available on the Freeware CD-ROM). The exact version isn't too critical, since all we want are the fonts it comes with.

Next, download and run the Xpdf package self-extracting archive. This creates a subdirectory [.XPDF-PACKAGES] that contains the package files themselves. Now all you need to do is

    $ SET DEFAULT [.XPDF-PACKAGES]
    $ PRODUCT INSTALL XPDF
    

and follow the (simple) instructions. The PCSI utility should automatically install the needed dependencies. These packages have been tested on OpenVMS/Alpha version 7.3-1

Printing

When printing on Unix, Xpdf opens a pipe to a user-specified "print command" using the popen(3) library function and then writes the PostScript to the resulting FILE pointer, thereby sending it to the standard input of that command. One could probably emulate this behavior on VMS by specifying PRINT SYS$INPUT as the print command and using the popen library function that also exists in the VMS C run-time library. However, this seems rather unnatural for VMS, so I modified the code so that the print dialog prompts the user for the name of a print queue instead of a print command, and then submits the postscript directly to that queue using SYS$SNDJBCW. If you leave the name of the queue blank and the logical name SYS$PRINT exists, then it submits the job to that queue.

A note on header files

I decided to put all the header files that come with the two shared libraries (T1Lib and FreeType) into text libraries. I find it easier to add a text library to the end of the compile command, thus:

    $ CC FOO.C+SYS$LIBRARY:FREETYPE2.TLB/LIB
    

rather than go through all the usual logical name gymnastics required to deal with include paths with subdirectories (e.g. "#include <sys/types.h>").

Resources

Updated 20-MAY-2007 by Charles M. "Chip" Coldwell
Valid XHTML 1.0!