CentOS Installation Swftools Service (PDF2SWF)

Source: Internet
Author: User

First step: Download swftools-0.9.2.tar.gz

Step Two: Swftools

TAR-XZVF swftools-0.9.2.tar.gz
CD swftools-0.9.2
./configure
Make
Make install
Make clean
Make Distclean
Whereis pdf2swf

Common errors:
① cannot find the JPEG command
jpeg.c:462:error:conflicting types for ' Jpeg_load_from_mem '
jpeg.h:15:note:previous declaration of ' Jpeg_load_from_mem ' is here

Solutions,
Download sjpegsrc.v9a.tar.gz
Install JPEG
TAR-XZVF jpegsrc.v9a.tar.gz
CD jpeg-9a
./configure
Make
Make install
Make clean
Make Distclean


② errors that are undefined and go to use:
: Info:build jpeg.c:109:35:error:use of undeclared identifier ' TRUE '
: Info:build jpeg_set_quality (&cinfo,quality,true);
: Info:build

Solution, modify a file in swftools-0.9.2:

VI lib/jpeg.c

#ifdef Have_jpeglib
#define Have_boolean
#include

Switch
#ifdef Have_jpeglib
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
#define Have_boolean
#include

③ unable to find FreeType command error
Yum Install FreeType

④./LIB/LIBGFX.A (GFXFONT.O): in function ' Gfxfont_free ':
GFXFONT.C: (. text+0x56): Undefined reference to ' glyph_clear '
Collect2:ld returned 1 exit status
MAKE[1]: * * * [Swfrender] Error 1
MAKE[1]: Leaving directory '/HOME/FZ/SWFTOOLS-0.9.1/SRC '
Make: * * * [ALL] Error 2

Solution:
Yum Install Freetype-devel


⑤ issues that may be encountered
Modules/. /./types.h:39:2: Error: #error "No-to-define-bit integer"
Modules/. /./types.h:42:2: Error: #error "don ' t know how to define-bit integer"
Modules/. /./types.h:45:2: Error: #error "don ' t know how to define-bit integer"
Modules/. /./types.h:48:2: Error: #error "don ' t know how to define 8 bit integer"
Workaround:
[root~]# Ldconfig/usr/local/lib
And then execute
[root~]#./configure
Make
Make install

⑥ may also encounter problems
MAKE[1]: * * [Install] Error 1
MAKE[1]: Leaving directory '/root/swftools-0.9.2/swfs '
Make: * * [Install] Error 2
Workaround:
Remove-o-l from two files in makefile and makefile.in in the SWFs directory
Make install
Success


After the installation is complete, the pdf2swf-h has a Help content display, which proves the installation was successful.
If the converted PDF does not contain Chinese, then this will work as expected.
If you include Chinese, you need to use the font library to Xpdf

Step three: Test whether the command was successful
Pdf2swf-t 9-s poly2bitmap-s zoom=150-s flashversion=9 "/usr/local/app/xxxie/1.pdf"-O "/usr/local/app/xxxie/1.swf"

If the pdf2swf command cannot be found, you need to add pdf2swf to the environment variable
Vim/etc/profile
Export path= $PATH:/usr/local/swftools/bin/

If Chinese is garbled, take the fourth step

Fourth step: Install the Xpdf language pack.
Download xpdf-chinese-simplified.tar.gz to http://www.foolabs.com/xpdf/download.html
TAR-XZVF xpdf-chinese-simplified.tar.gz
Unzip to any path, e.g./usr/local/xpdf/xpdf-chinese-simplified
Download
Http://ftp.gnu.org/gnu/non-gnu/chinese-fonts-truetype/gkai00mp.ttf.gz
Http://ftp.gnu.org/gnu/non-gnu/chinese-fonts-truetype/gbsn00lp.ttf.gz
Extract the TTF files Gkai00mp.ttf and Gbsn00lp.ttf, and put them under the/usr/local/xpdf/xpdf-chinese-simplified/cmap/path
5. Configuring the/USR/LOCAL/XPDF/XPDF-CHINESE-SIMPLIFIED/ADD-TO-XPDFRC File
#-----Begin Chinese Simplified Support package (2011-SEP-02)
Cidtounicode Adobe-gb1/usr/local/xpdf/xpdf-chinese-simplified/adobe-gb1.cidtounicode
Unicodemap Iso-2022-cn/usr/local/xpdf/xpdf-chinese-simplified/iso-2022-cn.unicodemap
Unicodemap Euc-cn/usr/local/xpdf/xpdf-chinese-simplified/euc-cn.unicodemap
Unicodemap Gbk/usr/local/xpdf/xpdf-chinese-simplified/gbk.unicodemap
Cmapdir Adobe-gb1/usr/local/xpdf/xpdf-chinese-simplified/cmap
Tounicodedir/usr/local/xpdf/xpdf-chinese-simplified/cmap
DISPLAYCIDFONTTT Adobe-gb1/usr/local/xpdf/xpdf-chinese-simplified/cmap/gkai00mp.ttf
DISPLAYCIDFONTTT Adobe-gb1/usr/local/xpdf/xpdf-chinese-simplified/cmap/gbsn00lp.ttf
#-----End Chinese Simplified support package


Test whether the command was successful

Pdf2swf-s languagedir=/usr/local/xpdf-chinese-simplified-t 9-s poly2bitmap-s zoom=150-s flashversion=9 "/usr/local/a Pp/xxxie/1.pdf "-O"/usr/local/app/xxxie/1.swf "

CentOS Installation Swftools Service (PDF2SWF)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.