因为官方提供安装包是支持 Ubuntu、Alpine 系统,Centos 需要手动编译进行安装,我安装版本 pdf2htmlEX v0.18.8
pdf2htmlEX v0.18.8 版本依赖两个重要库, Poppler 0.89.0 版本,FontForge 20200314 版本,依赖库版本很重,需要看官方文档确认版本
yum install cmake gcc gcc-c++ gnu-getopt java-1.8.0-openjdk libpng-devel fontforge-devel cairo-devel poppler-devel libspiro-devel poppler-data libjpeg-turbo-devel git fontconfig-devel glibc-static glibc-devel libtool-ltdl-devel zlib-devel poppler-glib-devel mk-configure.noarch libjpeg-turbo libtiff giflib-devel libXt-devel automake bzip2 libuninameslist-devel libspiro dbus-python-devel pango-devel chrpath uuid-c++ uuid uthash-devel.noarch jpackage-utils.noarch gettext libxml2-python27 libxml2-python26 python27-python-devel libxslt-python26 libxslt libxslt-devel python-devel python-javapackages.noarch –nogpgcheck poppler-cpp poppler-cpp-devel libstdc++48-static openjpeg-devel libjpeg libjpeg-devel libpng freetype freetype-devel libxml2 libxml2-devel zlib glibc glib2 glib2-devel bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel libtool libtool-libs libevent-devel libevent openldap openldap-devel nss_ldap openldap-clients openldap-servers libtool-ltdl bison vim wget make crontabs mlocate ntp lrzsz autoconf libx* qt-* qt4-devel libtiff libopen* gtk2 gtk2-devel gtk2-devel-docs kernel-devel gtk-doc cjkuni-uming-fonts cjkuni-ukai-fonts
tar -xvf poppler-0.89.0.tar.xz
mkdir build
cd build
cmake .. -DBUILD_SHARED_LIBS=OFF
make
sudo make install
~/.bashrc
或 ~/.bash_profile
设置环境变量export CPLUS_INCLUDE_PATH=~/poppler-0.89.0:~/poppler-0.89.0/poppler:$CPLUS_INCLUDE_PATH
source ~/.bashrc 或 source ~/.bash_profile
mkdir build
cd build
cmake .. -DBUILD_SHARED_LIBS=OFF
make
sudo make install
ln -s ~/pdf2htmlEX/poppler ~/poppler-0.89.0
ln -s ~/pdf2htmlEX/fontforge ~/fontforge-20200314
cd ~/pdf2htmlEX/pdf2htmlEX
cmake .