• linux下安装swftools工具


     swfTools是一种实用工具与Adobe Flash文件(swf文件)工作的集合。可以把(pdf/gif/png/jpeg/jpg/font/wav) 7种格式转换为swf文件。一般常用于文件在线浏览等。

    swftools官网及下载地址:http://www.swftools.org/download.html

    (1)tar -zxvf 【swftools-0.9.2.tar.gz所在的实际全路径】

    (2)cd swftools-0.9.2

    (3) ./configure  或./configure --prefix=路径,

    (4)make

    (5)make install

    (6)make clean

    (7)make distclean

    (8)whereis pdf2swf  

    ==========================

    configure是用来检测你的安装平台的目标特征的。比如它会检测你是不是有CC或GCC。并生成 Makefile文件,为下一步的编译做准备,可以在configure 后加上参数来对安装进行控制。如:./configure --prefix=路径,这样在makeinstall时会安装到指定路径。

    make是用来编译的,它从Makefile中读取指令,然后编译。

    make insatll:将程序安装至系统中,它也从Makefile中读取指令,安装到默认或指定的位置。如果原始码编译无误,且执行结果正确,便可以把程序安装至系统预设的可执行文件存放路径。这一步一般需要你有 root 权限(因为要向系统写入文件)

    make clean:清除编译产生的可执行文件及目标文件(object file,*.o)。

    make distclean:除了清除可执行文件和目标文件外,把configure所产生的Makefile也清除掉。

    ==============

    简单测试:

    进入pdf2swf所有目录,在该目录下放一个pdf文件test.pdf,执行命令pdf2swf test.pdf test.swf,正常情况下会生成一个test.swf的转换文件。

    可以通过:pdf2swf -h 命令,来查看swftools的一些命令.如果不给./configure 指定安装目录的话,默认安装到 /usr/local/bin/pdf2swf

     使用pdf2swf -V命令检测是否安装成功,如果安装成功会找到如下命令:

    [root@rusky]# pdf2swf -V
    pdf2swf - part of swftools 2013-04-09-1007

    ================================================

    http://www.360doc.com/content/14/1112/14/20361513_424542110.shtml

    第一步安装openoffice

    安装最新的openoffice 需要最新的系统,redhadserver5.5不行,因为里面GLIBC最高是2.5的,最新的openoffice需要GLIBC_2.11。所以openoffice安装到了线上的CentOS 6.3上面。

    1:下载最新的 openoffice 

    地址:

    http://jaist.dl.sourceforge.net/project/openofficeorg.mirror/localized/zh-CN/3.4.1/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-rpm_zh-CN.tar.gz

    >wget http://jaist.dl.sourceforge.net/project/openofficeorg.mirror/localized/zh-CN/3.4.1/Apache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-rpm_zh-CN.tar.gz

    下载文件。

    2:下载完成后解压

    tar xfApache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-rpm_zh-CN.tar.gz 

    [root~]# tar xfApache_OpenOffice_incubating_3.4.1_Linux_x86-64_install-rpm_zh-CN.tar.gz

    3.安装软件

    [root~]# cd zh-CN/

    [root~]# cd RPMS

    安装所有的rpm

    [root~]# yum localinstall *.rpm   //注意,请用  yum localinstall 而不是 yum install

    也可以使用rpm -ivh *.rpm(推荐,少报错)

    然后再安装desktop-integration下的openoffice.org3.4-redhat-menus-3.4-9593.noarch.rpm

    注意可能需要重新安下openoffice.org-ure-3.4.1-9593.x86_64.rpm 这个rpm 在RPMS目录下

    4.启动服务

    进入安装目录/opt/openoffice.org3/program

    执行命令:soffice-headless -accept="socket,host=127.0.0.1,port=8100;urp;"-nofirststartwizard &

    可能遇到的问题1

    [program~]$ soffice -headless-accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard&

    [1] 3094

    [program~]$ /opt/openoffice.org3/program/soffice.bin: error while loading sharedlibraries: libuno_sal.so.3: cannot open shared object file: No such file ordirectory

    [1]+  Exit 127                soffice -headless-accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard

    解决方法 

    重新装openoffice.org-ure-3.4.1-9593.x86_64.rpm

    进入RPMS 目录

    [program~]$ sudorpm -ivh openoffice.org-ure-3.4.1-9593.x86_64.rpm

    Preparing...               ########################################### [100%]

      1:openoffice.org-ure     ###########################################[100%]

    然后重新进入

    [keylogic@AY1303191548348936fe RPMS]$ cd/opt/ openoffice.org3/program/

    可能遇到的问题2

    Openoffice启动是要java支持的,所有系统要先安装java

    第二步安装SWFtools

    一. swftools需要freetype-2.4.6.tar.gz和jpegsrc.v8c.tar.gz两个组件,才能编译通过;

    二. 在转换包含中文的PDF文档时,常常会因为缺少所需的字体而出现乱码,或者干脆就没有文字。

    当时也是查了很多前辈大牛的资料,才安装成功,现在整理一下安装的过程,作为存储。

    安装过程:

    1. 下载swftools-2011-01-23-1815.tar.gz和freetype-2.4.6.tar.gz、jpegsrc.v8c.tar.gz两个组件(附件中有)

    2. 执行一下命令,安装两个组件

       tar -xzvf freetype-2.4.6.tar.gz

       cd freetype-2.4.6

       ./configure

       make

       make install

       tar -xzvf jpegsrc.v8c.tar.gz

       cd jpeg-8c

       ./configure

       make

       make install

    如果报错:/usr/bin/install: 无法创建普通文件"/usr/local/man/man1/cjpeg.1": 没有那个文件或目录
    make: *** [install] 错误 1

    先创建文件夹:mkdir -p /usr/local/man/man1 然后在make install即可。

    3. 安装swftools

       tar -xzvf swftools-2011-01-23-1815.tar.gz

       cd swftools-2011-01-23-1815

       ldconfig  /usr/local/lib

       ./configure

       make

       make install

       安装完成后执行一下,pdf2swf -h 有帮助内容显示,则证明安装成功

       如果所转换的PDF不包含中文,则到此为止就可以正常使用了。

       如果包含中文,就需要使用到xpdf的字体库

    4. 到http://www.foolabs.com/xpdf/download.html下载xpdf-chinese-simplified.tar.gz

       tar -xzvf xpdf-chinese-simplified.tar.gz

       解压到任意路径,例如/usr/local/xpdf/xpdf-chinese-simplified

       下载

    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

       解压出ttf文件gkai00mp.ttf和gbsn00lp.ttf,放到/usr/local/xpdf/xpdf-chinese-simplified/CMap/路径下

    5. 配置/usr/local/xpdf/xpdf-chinese-simplified/add-to-xpdfrc文件

       #----- 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

    注意红色部分的路径,需要按照实际xpdf-chinese-simplified文件夹的路径修改。

    如果在转换过程中出现:

    Error: Couldn't find a font for '宋体'

    或者

    ERROR   Internal error: No current splash fontinfo

    或者

    ERROR   Invalid charid 1 for font 0x60000000000ac370 (0 characters)

    需要自己在网上,或者本机的c:/Windows/fonts目录下寻找相应的确实字体(例如‘宋体’),然后放置在CMap文件夹内,按照斜线部分在add-to-xpdfrc文件中添加相应的配置,即可。

     freetype-2.4.6.tar.gz 下载地址:https://skydrive.live.com/redir?resid=50E13C8D81C05C21!970

     jpegsrc.v8c.tar.gz 下载地址:https://skydrive.live.com/redir?resid=50E13C8D81C05C21!969

     xpdf-chinese-simplified.tar.gz 下载地址:https://skydrive.live.com/redir?resid=50E13C8D81C05C21!968

  • 相关阅读:
    平衡二叉树之RB树
    平衡二叉树之AVL树
    实现哈希表
    LeetCode Median of Two Sorted Arrays
    LeetCode Minimum Window Substring
    LeetCode Interleaving String
    LeetCode Regular Expression Matching
    PAT 1087 All Roads Lead to Rome
    PAT 1086 Tree Traversals Again
    LeetCode Longest Palindromic Substring
  • 原文地址:https://www.cnblogs.com/rusking/p/4023145.html
Copyright © 2020-2023  润新知