如何编译安装poppler-glib?

编译安装

1 基础知识

1.1 Poppler的简介

– Poppler最初起源于XPDF
– Poppler是一个专用的类库

1.2 Poppler的作用

– Poppler可用于渲染PDF文件并检查或修改其结构

2 最佳实践

2.1 环境信息

OS = CentOS 8.1 x86_64
IP Address = any
Host Name = any.cmdschool.org

2.2 安装前的准备

2.2.1 下载软件包

cd ~
wget https://github.com/freedesktop/poppler/archive/poppler-0.83.0.tar.gz

2.2.2 解压软件包

cd ~
tar -xf poppler-poppler-0.83.0.tar.gz

2.2.3 准备编译环境

yum -y install gcc gcc-c++ cmake

2.2 编译安装

2.2.1 预编译软件包

cd ~/poppler-poppler-0.83.0/
cmake . -DCMAKE_INSTALL_BINDIR=/usr/bin \
        -DCMAKE_INSTALL_SBINDIR=/usr/sbin \
        -DCMAKE_INSTALL_LIBEXECDIR=/usr/libexec \
        -DCMAKE_INSTALL_SYSCONFDIR=/etc \
        -DCMAKE_INSTALL_LOCALSTATEDIR=/var \
        -DCMAKE_INSTALL_LIBDIR=/usr/lib64 \
        -DCMAKE_INSTALL_INCLUDEDIR=/usr/include \
        -DCMAKE_INSTALL_DATAROOTDIR=/usr/share \
        -DCMAKE_INSTALL_INFODIR=/usr/share/info \
        -DCMAKE_INSTALL_LOCALEDIR=/usr/share/locale \
        -DCMAKE_INSTALL_MANDIR=/usr/share/man \
        -DCMAKE_INSTALL_DOCDIR=/usr/share/doc/poppler

如果遇到如下错误,

CMake Error at CMakeLists.txt:137 (message):
  Install libjpeg before trying to build poppler.  You can also decide to use
  the internal unmaintained DCT decoder or none at all.

可通过如下命令解决依赖关系,

 yum install -y libjpeg-turbo-devel

如果遇到如下错误,

 CMake Error at CMakeLists.txt:207 (message):
  Install libopenjpeg2 before trying to build poppler.  You can also decide
  to use the internal unmaintained JPX decoder or none at all.

我们建议使用编译安装解决以上依赖关系,
https://www.cmdschool.org/archives/9682
另外可通过如下简单的命令解决依赖关系(当前系统测试未通过),

yum install -y openjpeg2

如果遇到如下错误,

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find Freetype (missing: FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS)

可通过如下命令解决依赖关系,

yum install -y freetype-devel

如果遇到如下错误,

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find Fontconfig (missing: FONTCONFIG_LIBRARIES
  FONTCONFIG_INCLUDE_DIR)

可通过如下命令解决依赖关系,

yum install -y fontconfig-devel

2.2.2 编译软件包

make

2.2.3 安装软件包

make install

另外,安装完毕发现incloud没有出现指定的目录,可使用如下命令修正,

ln -s /usr/local/include/poppler /usr/include/

参阅文档
====================

软件的github
—————
https://github.com/freedesktop/poppler

软件下载
————-
https://github.com/freedesktop/poppler/releases

没有评论

发表评论

编译安装
如何编译安装ifstat?

1 前言 一个问题,一篇文章,一出故事。 生产上的老旧服务器RHEL 5没有ifstat的rpm包, …

编译安装
如何安装GNU编译器gcc和g++?

1 基础知识 1.1 GNU Compiler Collection的简介 – GCC原 …

Sendmail
如何编译安装Sendmail?

1 Sendmail的简介 – Sendmail是一种重要的邮件传输代理程序(MTA即M …