感谢支持
我们一直在努力

CentOS 5.5 PDF转TXT

CentOS 5.5 PDF转TXT

安装djvulibre-3.5.24
下载地址:http://djvu.sourceforge.net/
下载压缩包解压好
# ./configure
# make && make install && make clean

安装poppler-0.18.3.tar.gz
下载地址:http://poppler.freedesktop.org/
# ./configure –enable-xpdf-headers –disable-poppler-qt4 –disable-cms –disable-poppler-cpp
# make && make install && make clean
安装poppler过程出错处理:
Package requirements (fontconfig >= 2.0.0) were not met:
解决办法:通过yum 安装 fontconfig-devel,再configure通过。

配置时必需添加 –enable-xpdf-headers 参数,否则安装pdf2djvu-0.7.12时会提示 fatal error: GfxState.h: No such file or directory

安装pdf2djvu-0.7.12
下载地址:http://code.google.com/p/pdf2djvu/
# ./configure –prefix=/usr/local/pdf2djvu-0.7.12 –without-graphicsmagick –without-xslt
# make && make install && make clean

可以指定使用的编译器
#./configure CFLAGS=”-O3″ CC=”gcc462″ CXXFLAGS=”-O3″ CXX=”g++462″ –prefix=/usr/local/pdf2djvu-0.7.12 –without-graphicsmagick –without-xslt

设置库的头文件查找路径,以下方式紧当前shell有用
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:$PKG_CONFIG_PATH

 

错误处理:
checking for DJVULIBRE… no
configure: error: Package requirements (ddjvuapi >= 3.5.17) were not met:
No package ‘ddjvuapi’ found
设置库的头文件查找路径
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH

提示POPPLER版本过低
checking for POPPLER… no
configure: error: Package requirements (poppler-splash >= 0.7.3) were not met:
下载新版安装

提示找不到:GfxState.h
g++ -fopenmp -g -O2 -Wall -Werror=overloaded-virtual -pthread -I/usr/local/include  -I/usr/local/include/poppler      -c -o config.o config.cc
cc1plus: error: unrecognized command line option “-Werror=overloaded-virtual”
重新安装poppler-0.18.3.tar.gz 添加 –enable-xpdf-headers 参数

gcc编译器版本太低
安装最新版gcc方法参看“CentOS 5.5 手动安装 GCC4.6.2” http://www.linuxidc.com/Linux/2014-01/95388.htm

使用方法:
# ./pdf2djvu -o /data/sphinx_doc_zhcn_0.9.djvu /data/sphinx_doc_zhcn_0.9.pdf
# djvutxt /data/sphinx_doc_zhcn_0.9.djvu /data/sphinx_doc_zhcn_0.9.txt
djvutxt默认在/usr/bin目录下

更多CentOS相关信息见CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14

赞(0) 打赏
转载请注明出处:服务器评测 » CentOS 5.5 PDF转TXT
分享到: 更多 (0)

听说打赏我的人,都进福布斯排行榜啦!

支付宝扫一扫打赏

微信扫一扫打赏