1.下载源码
https://poppler.freedesktop.org/
2.命令行编译命令
mkdir build
cd build
cmake ..
make
make install
如果提示有缺少的库,sudo 安装即可
-- Found Freetype: /usr/lib/x86_64-linux-gnu/libfreetype.so (found version "2.8.1")
-- Checking for module 'fontconfig'
-- Found fontconfig, version 2.12.6
-- Found Fontconfig: /usr/lib/x86_64-linux-gnu/libfontconfig.so
-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.34")
-- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
-- Checking for module 'nss>=3.19'
-- No package 'nss' found
-- Could NOT find NSS3 (missing: NSS3_LIBRARIES NSS3_CFLAGS)
CMake Error at CMakeLists.txt:143 (message):
Install libjpeg before trying to build poppler. You can also decide to use
the internal unmaintained DCT decoder or none at all.
-- Configuring incomplete, errors occurred!
See also "/home/john/work/poppler-20.08.0/build/CMakeFiles/CMakeOutput.log".
See also "/home/john/work/poppler-20.08.0/build/CMakeFiles/CMakeError.log".
缺少jpeg sudo apt-get install libjpeg-dev
再次 cmake
sudo apt-get install libopenjp2-7-dev
sudo apt-get install libboost-dev