swftools linux下安装

来源:互联网 发布:深圳网络推广方法 编辑:程序博客网 时间:2024/05/16 12:19
1、下载:
http://www.swftools.org/download.html
文件为:swftools-0.9.2.tar.gz
安装文档:
http://wiki.swftools.org/wiki/Installation#How_to_compile.2Flink_swftools_on_Unix.2FLinux.2FBSD.3F
2、解压:
tar -xzf swftools-0.9.2.tar.gz
解压后得到文件夹:
swftools-0.9.2
3、安装中文支持

中文支持安装:

1)  mkdir –p /usr/share/xpdf

cd /usr/share/xpdf/

2)  下载中文支持及字体库

wget  ftp://ftp.foolabs.com/pub/xpdf/xpdf-chinese-simplified.tar.gz

 

wget  http://www.nginxs.com/download/font.zip

3) tar zxvf xpdf-chinese-simplified.tar.gz

         unzip font.zip

mv Gbsn00lp.ttf gkai00mp.ttf xpdf-chinese-simplified/CMap/

cd /usr/share/xpdf/xpdf-chinese-simplified

4)vi add-to-xpdfrc

内容如下:

cidToUnicode   Adobe-GB1       /usr/share/xpdf/chinese-simplified/Adobe-GB1.cidToUnicode

unicodeMap     ISO-2022-CN    /usr/share/xpdf/chinese-simplified/ISO-2022-CN.unicodeMap

unicodeMap     EUC-CN             /usr/share/xpdf/chinese-simplified/EUC-CN.unicodeMap

unicodeMap     GBK           /usr/share/xpdf/chinese-simplified/GBK.unicodeMap

cMapDir            Adobe-GB1       /usr/share/xpdf/chinese-simplified/CMap

toUnicodeDir                      /usr/share/xpdf/chinese-simplified/CMap

displayCIDFontTT Adobe-GB1 /usr/share/xpdf/chinese-simplified/CMap/gkai00mp.ttf

保存后退出

4、相关Lib包安装:

1)  yum –y install gcc-c++(如果已安装可跳过)

2)  yum install giflib-devel.x86_64

3)  yum install zlib-devel.x86_64

4)  yum install freetype-devel.x86_64

5)  yum install libjpeg-devel.x86_64

 

5、SwfTool安装:

1)cd /usr/local/

2)wget  http://www.swftools.org/swftools-0.9.1.tar.gz

3)tar zxvf swftools-0.9.1.tar.gz

4)cd swftools-0.9.1

5)./configure --prefix=/usr/local/swftools/,可能报错,需要添加--build=i686-pc-linux-gnu:

./configure --prefix=/usr/local/swftools/ --build=i686-pc-linux-gnu

6)make

7)make install

8)测试一下是否可用

pdf2swf -o /path/output.swf -T -z -t -f /path/yourpdffile.pdf -s languagedir=/usr/share/xpdf/xpdf-chinese-simplified -s flashversion=9

 
官方文档:

How to compile/link swftools on Unix/Linux/BSD?

Some distributions of Linux have swftools available in their standard repositories. In this case, installation is immediate: just use the package manager and order it to install swftools. For example, those that use yum it will just require the command (as root) yum install swftools, those with urpmi just urpmi swftools, etc. If this does not work, try the method below (beware of dependency hell!)
Download swftools-0.x.x.tar.gz. Then type, on the command-line:
   tar -zvxf swftools-0.x.x.tar   cd swftools-0.x.x   ./configure   make    make install
(you will have to be root for the last step)
What libraries do I need to compile swftools on Unix/Linux/BSD?
You need freetype and jpeglib to compile pdf2swf. Links:
 * freetype: http://www.freetype.org * jpeglib:  http://www.ijg.org/files/
NB jpeglib is now at version 8. Version 6, appears to be no longer available. Should you happen to know a link, please post it here.
 libjpeg-6a can be found here - ftp://sunsite.unc.edu/pub/Linux/libs/graphics/ libjpeg 6b1-2 debs here - http://packages.debian.org/search?keywords=libjpeg6
For the later versions you will also need to place the tar g'zipped distribution of xpdf in the lib/pdf folder of the unpacked SWFTools distribution, i.e.
 * cd swftools/lib/pdf * wget ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.03.tar.gz * cd ../../ * ./configure [ -- your_compiler_flags ]
When compiling, configure might give the following error -
 checking for missing libraries...  ungif gif_lib.h *************************************************** * The following headers/libraries are missing:  ungif gif_lib.h * Disabling gif2swf tool... ***************************************************
ungif may no longer be used in your distro.
libgif-dev is the new build package, use this instead.
When compiling the sourcecode version, configure doesn't find my jpeglib!
In case some of your libraries/include files are installed in /usr/local, try the following:
 rm -f config.cache LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure
Furthermore, a new installation of jpeglib (the following assumes it's in /usr/local/lib) often requires doing a:
 ranlib /usr/local/lib/libjpeg.a ldconfig /usr/local/lib
In order to install jpeglib, it's furthermore been remarked that you need to do:
 make install-lib make install-headers
If it still doesn't work, try removing the file "config.cache" before running configure again.
There are problems during compilation
Error messages complain about "undefined reference to `operator new(unsigned)'" as well as "undefined reference to `__gxx_personality_v0'".
Try running configure as
 LDFLAGS=-lstdc++ ./configure
0 0
原创粉丝点击