Installing swftools and pdf2swf on CentOS / Scientific Linux

Main site, http://swftools.org, has pretty good wiki for documentation and a tidy installation walkthrough. Unfortunately for me I had a ton of problems getting pdf2swf to work properly on CentOS 6.3 x86_64, but fortunately for you I finally got it working and also put together this guide, which will hopefully save you some time.

Note: swftools version that comes default with yum would not work for me hence the need to compile from source.
Note2: this guide assumes the distro is up to date and all system libraries have been installed

Get necessary libraries and extract, I m using 0.9.1 as 0.9.2 as on date give error while make install.
wget http://swftools.org/swftools-0.9.1.tar.gz
tar -zvxf swftools-0.9.1.tar.gz

wget http://www.ijg.org/files/jpegsrc.v7.tar.gz
tar -zvxf jpegsrc.v9.tar.gz

wget http://download.savannah.gnu.org/releases-noredirect/freetype/freetype-2.4.11.tar.gz
tar -zvxf freetype-2.4.11.tar.gz

Now order of install. First we install jpeg:
cd jpeg-9
sudo ./configure
sudo make
sudo make install

Freetype is a little trickier. For install you have to reset cache, set flags, run ranlib (not sure why but it wouldn’t work without for me, if you know I’d love an explanation)
cd freetype-2.4.11
rm -f config.cache
sudo ranlib /usr/local/lib/libjpeg.a
sudo ldconfig /usr/local/lib
sudo LDFLAGS=”-L/usr/local/lib” CPPFLAGS=”-I/usr/local/include” ./configure
sudo make
sudo make install

If you want to be able to convert pdf files into text you have to install xpdf. This comes with latest version of swftools. /lib/pdf/xpdf

And now for the final step:
cd swftools-0.9.1
sudo LDFLAGS=”-L/usr/local/lib” CPPFLAGS=”-I/usr/local/include” ./configure
sudo make
sudo make install
Big thanks to swftools for making this possible.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s