swftools linux下安装

1、下载:
文件为:swftools-0.9.2.tar.gz
安装文档:
http://wiki.swftools.org/wiki/Installation#How_to_compile.2Flink_swftools_on_Unix.2FLinux.2FBSD.3F
2、解压:
tar -xzfswftools-0.9.2.tar.gz
解压后得到文件夹:
swftools-0.9.2
3、安装中文支持

中文支持安装:

1)mkdir –p /usr/share/xpdf

cd /usr/share/xpdf/

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

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

wgethttp://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

内容如下:

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

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

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

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

cMapDirAdobe-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)wgethttp://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 yumit will just require the command (as root) yum install swftools, those with urpmijust 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 xpdfin 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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值