pdf2htmlEX 一个可以把pdf 转换为 html 的神器
下面的配置还安装了 ghostscript 可以对pdf文件进行错误修复,具体使用Baidu查查
-
下载
pdf2htmlEX
https://github.com/coolwanglu/pdf2htmlEX/releases
-
下载
fontforge
,整个项目下载下来https://github.com/coolwanglu/fontforge/tree/pdf2htmlEX
-
这里示例为把两个压缩包放到
/pdf_install
,自行替换命令中的相关路径yum install -y autoconf automake libtool* cmake gcc gnu-getopt libpng-devel fontforge-devel cairo-devel poppler-devel libspiro-devel freetype-devel poppler-data libjpeg-turbo-devel git make gcc-c++ pango-devel && yum install -y unzip libjpeg-turbo.x86_64 libjpeg-turbo-devel libjpeg-turbo-devel.x86_64 libtiff.x86_64 libtiff-devel openjpeg-devel.x86_64 openjpeg giflibgiflib-devel libxml2.x86_64 libxml2-devel libspiro.x86_64 libspiro-devel libuninameslist-devel.x86_64 && cd /pdf_install && unzip pdf2htmlEX-0.14.6.zip && unzip fontforge-pdf2htmlEX.zip && export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig && export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH && cd /pdf_install/fontforge-pdf2htmlEX && ./autogen.sh && ./configure && make && make install && cd /pdf_install/pdf2htmlEX-0.14.6 && cmake . && make && make install && yum install -y ghostscript && echo "/usr/local/lib" >> /etc/ld.so.conf && /sbin/ldconfig -v
-
以上命令原本是写到
Dockerfile
的,环境为centos7