I just download poppler to Linux system,and I want to incorporate it in my app to parse pdf file.
(My goal is to convert pdf file to plain text.)
How can I do this?
Poppler's git tree includes a useless INSTALL
doc that just tells you to run ./configure
, but they don't include automake/autoconf auto-generated files (including configure) in git. (Probably they do include them in tarball source releases.)
I just built poppler from git source (on Ubuntu 15.04) like so:
git clone --depth 50 --no-single-branch git://git.freedesktop.org/git/poppler/poppler
cmake -G 'Unix Makefiles' # other -G options are to generate project files for various IDEs
# look at the output. If it didn't find some libraries,
# install them with your package manager and re-run cmake
make -j4
# optionally:
sudo make install
It appears that they maintain an autoconf/automake build setup, so you can use that OR cmake to create a Makefile
.
If you just want to see if the latest git poppler works better than the distro package, you don't need to sudo make install
, you can just run utils/pdftotext
or whatever right from the source directory. It apparently tells the linker to embed the build path into the binary, as a library search path, so running /usr/local/src/poppler/utils/pdftotext
works, and finds /usr/local/src/poppler/libpoppler.so.52
.
If the latest poppler does work better than the distro-packaged poppler, you should install it to /usr/local/bin
with sudo make install
. When you upgrade to the next version of your distro, check your /usr/local. Often the new distro version will be newer than when you built it from source, so you should just remove your version from /usr/local/{bin,share,lib,man,include}
. (Or make uninstall
in the source dir, if supported).
Their website explains it very clearly :
Poppler is available from git. To clone the repository use the following command:
git clone git://git.freedesktop.org/git/poppler/poppler
Once you download the source code, read the INSTALL
file where it says :
cd
to the directory containing the package's source code and type./configure
to configure the package for your system.Type `make' to compile the package.
Type `make install' to install the programs and any data files and documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With