Wednesday, 1 August 2012

Installing swftools and pdf2swf on Ubuntu Linux

SWFTools is a collection of utilities for working with Adobe Flash files (SWF files). 



PDF2SWF -- A PDF to SWF Converter. Generates one frame per page. Enables you to have fully formatted text, including tables, formulas, graphics etc. inside your Flash Movie. It's based on the xpdf PDF parser from Derek B. Noonburg.
SWFCombine -- A multi-function tool for inserting SWFs into Wrapper SWFs, contatenating SWFs, stacking SWFs or for basic parameter manipulation (e.g. changing size).
SWFStrings -- Scans SWFs for text data.
SWFDump -- Prints out various informations about SWFs, like contained images/fonts/sounds, disassembly of contained code as well as cross-reference and bounding box data.
JPEG2SWF -- Takes one or more JPEG pictures and generates a SWF slideshow from them. Supports motion estimation compression (h.263) for better compression of video sequences.
PNG2SWF -- Like JPEG2SWF, only for PNGs.
GIF2SWF -- Converts GIFs to SWF. Also able to handle animated gifs.
WAV2SWF -- Converts WAV audio files to SWFs, using the L.A.M.E. MP3 encoder library.
AVI2SWF -- Converts AVI animation files to SWF. It supports Flash MX H.263 compression. (Notice: this tool is not included anymore in the latest version, as ffmpeg or mencoder do a better job nowadays)
Font2SWF -- Converts font files (TTF, Type1) to SWF.
SWFBBox -- Allows to read out, optimize and readjust SWF bounding boxes.
SWFC -- A tool for creating SWF files from simple script files. Includes support for both ActionScript 2.0 as well as ActionScript 3.0.
SWFExtract -- Allows to extract Movieclips, Sounds, Images etc. from SWF files.
AS3Compile- A standalone ActionScript 3.0 compiler. Mostly compatible with Flex.

SWFTools has been reported to work on Solaris, Linux (both 32 as well as 64 bit), FreeBSD, OpenBSD, HP-UX, Solaris, MacOS X and Windows 98/ME/2000/XP/Vista.

Install SWFTools in ubuntu 12.04/11.10
Open the terminal and run the following commands
sudo add-apt-repository ppa:guilhem-fr/swftools
sudo apt-get update
sudo apt-get install swftools



Get necessary libraries and extract
2tar -zvxf swftools-0.9.0.tar.gz
4tar -zvxf jpegsrc.v7.tar.gz
6tar -zvxf freetype-2.3.12.tar.gz
Note: v8 produced errors in swftools install so I grabbed v7, which worked wonderfully.
Now order of install. First we install jpeg:
1cd jpegsrc.v7
2sudo ./configure
3sudo make
4sudo 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)
1cd freetype-2.3.12
2rm -f config.cache
3sudo ranlib /usr/local/lib/libjpeg.a
4sudo ldconfig /usr/local/lib
5sudo LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure
6sudo make
7sudo make install
If you want to be able to convert pdf files into text you have to install xpdf. Fortunately aptitude does provide us with the right libraries this time.
1sudo apt-get install xpdf-reader
And now for the final step:
1cd swftools-0.9.0
2sudo LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure
3sudo make
4sudo make install

1 comment:

  1. I have install swftool but pdf2swf missing in usr/local/bin. that's why i am getting pdf2swf error . how to install pdf2swf library.? when i run ./configure ,in my log i show error like disabling pdf2swf . kindly help me how to insall pdf2swf library

    ReplyDelete