04 March 2007

PDF, PostScript Viewer for Slackware 11

I am writing in LaTeX a lot these days, and I decided that my old laptop1 needed a versatile document viewer: something to read .pdf, .ps, perhaps .dvi files. Xpdf lacked certain fonts, and Evince seemed the obvious choice, but there were too many dependencies2.

Ghostscript compiled without too much trouble, but I wanted to spoil myself with a graphical user interface. Problems began—I was not able to get the GV program to compile, and GSView compiled but could open no files.

Here is what to do, and why:

  1. Tweak a Ghostscript sourcefile if you use gcc 3.4.6 on i686-pc-linux-gnu. I had never played in C before . . . scary. Due to


Edited ghostscript-8.54/src/gdevpdfe.c line 27 to read

typedef unsigned long long uint64_t;

  1. Compile GhostScript with shared object files.

tar -xzvf ghostscript-8.54.tar.gz

cd ghostscript-8.54

    GSView requires libgs.so, but the default compile for Ghostscript does not create them. So, in accordance with


Do the following in ghostscript-8.54 directory:

ln -s src/unix-gcc.mak makefile

make so

make soinstall

(I always run make and subsequent commands as root. It's amateur night in Linuxia.)

  1. Install the Ghostscript fonts.

tar -xzvf ghostscript-fonts-std-8.11.tar.gz

cd fonts


mkdir /usr/local/share/ghostscript/8.54/Resource/Font

cp * /usr/local/share/ghostscript/8.54/Resource/Font

  1. Install GSView.

tar -xzvf gsview-4.8.tar.gz

cd gsview-4.8

cp srcunx/unx.mak Makefile



make install

Before running make, I edited line 52 of Makefile to read


But I am pretty sure that this made no difference.

  1. Run GSView on a test file. In my case, I got two types of errors:

    • GSView needed the (installed) libgs.so file, but could not find it

    • GSView also could not find the fonts

Close the error windows with “Ok,” and click to Options-->Advanced Configure

Update Ghostscript Version


Give the correct location of Ghostscript Shared Object


Ghostscript Program as gs is fine

Add the fonts to the Ghostscript Include Path (see Step 3, above)


After closing the Advanced Configure dialog, you should be able to open your test file again.


1A $100 laptop, it turns out. More on this point to come.

2Since I run xfce.


Post a Comment

<< Home