1. install required libraries and components. Yuminstallgcc * automakezlib-devellibjpeg-develgiflib-develfreetype-devel2, download, compile, and install swftools. Wgethttp: // www.swftools.org/swftools-0.9.2.tar.gztarvxz
1. install required libraries and components.
yum install gcc* automake zlib-devel libjpeg-devel giflib-devel freetype-devel
2. download, compile, and install swftools.
wget http://www.swftools.org/swftools-0.9.2.tar.gz tar vxzf swftools- 0.9 . 2 .tar.gz cd swftools- 0.9 . 2 ./configure --prefix=/usr/local/swftools make make install
3. set swftools environment variables
vim /etc/profile export PATH=$PATH:/usr/swftools/bin/
4. install the xpdf language pack.
Download the xpdf-chinese-simplified.tar.gz file, decompress it to/usr/share/xpdf, and edit the add-to-xpdfrc File (download the Gbsn00lp. ttf gkai00mp. ttf font), as follows:
Tar zxvf xpdf-chinese-simplified.tar.gz
Unzip font.zip
Mv Gbsn00lp. ttf gkai00mp. ttf xpdf-chinese-simplified/CMap/
Cd/usr/share/xpdf-chinese-simplified
Vim add-to-xpdfrc
The content is as follows:
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
Save and exit
5. run the following command to test the conversion:
pdf2swf -s languagedir=/usr/share/xpdf/xpdf-chinese-simplified -T 9 -s poly2bitmap -s zoom=150 -s flashversion=9 "/opt/123.pdf" -o "/opt/test/%.swf"
Conversion successful! Done!
Appendix: Linux environment configuration file openOfficeStartCommand = /usr/lib/openoffice.org3/program/soffice.bin/ -headless\ -accept="socket,host=127.0.0.1,port=8100;urp;"\ -nofirststartwizard pdfToSwfCommand = /usr/local/swftools/bin/pdf2swf bitMapc=-T 9 -s poly2bitmap -s zoom=150 zoom=150 langc=-s languagedir=/usr/share/xpdfl/xpdf-chinese-simplified port = 8100