Friday, August 23, 2013

XPDF Segmentation fault (core dumped) SOLVED

I have a friend with a Linux Mint based on Ubuntu 13.04 that has to use a Java program (jnlp); this program has some print features that doesn't open a print dialog but fires XPDF directly. That's very annoying, because there is no possibility afaik to change the default pdf program inside the application. I suppose that the command is hard coded in the application itself.
The problem is that XPDF opens and shuts down immediately and no pdf is shown. Launching XPDF from a terminal window the following errors are thrown:

$ xpdf main.pdf
***** MediaBox = ll:0,0 ur:595.276,841.89
***** CropBox = ll:0,0 ur:595.276,841.89
***** Rotate = 0
Segmentation fault (core dumped)

After a lot of trials without any success I found the solution to fix that:

sudo apt-get install libfreetype6-dev libmotif-dev
tar xzpf xpdf-3.03.tar.gz
cd xpdf-3.03
./configure --with-freetype2-library=/usr/lib/i386-linux-gnu /
--with-freetype2-includes=/usr/include/freetype2 /
--with-Xm-library=/usr/lib /
sudo make install

I hope this can help somebody. Enjoy it.