Skip to content

Instantly share code, notes, and snippets.

@tertek
Forked from Dayjo/install-poppler-ubuntu.md
Last active June 29, 2022 10:51
Show Gist options
  • Save tertek/93f9547f1c5c81d24aca208799737668 to your computer and use it in GitHub Desktop.
Save tertek/93f9547f1c5c81d24aca208799737668 to your computer and use it in GitHub Desktop.
How to install Poppler on Ubuntu

First install all these prerequisites for compiling:

sudo apt install g++ libboost-all-dev autoconf libfontconfig1-dev pkg-config libjpeg-dev libopenjp2-7-dev gnome-common libglib2.0-dev gtk-doc-tools libyelp-dev yelp-tools gobject-introspection libsecret-1-dev libnautilus-extension-dev

First download the encoding files (no need to compile these) to the current working directory

wget https://poppler.freedesktop.org/poppler-data-0.4.11.tar.gz

Extract (it does untar cleanly):

tar -xf poppler-data-0.4.11.tar.gz

Enter the directory

cd poppler-data-0.4.11

And magically send the files to the right locations in /usr/share with:

sudo make install

Now go back up one level

cd ..

Download & extract the main package:

wget https://poppler.freedesktop.org/poppler-22.06.0.tar.xz
tar -xf poppler-22.06.0.tar.xz
cd poppler-22.06.0

Now run the configure file like this:

mkdir build
cd build
cmake ..

Here you will get errors if I missed anything from my list of dependencies above. The errors might be illuminating eg 'thing-you-need not found' in which case you can try sudo apt install thing-you-need and try again. If that doesn't work, try searching online for the error message.

If it exits without errors you can run:

make

Which will take a while. When it's done, you can use

sudo make install

If you use sudo make install you can still uninstall at any time by entering the source directory (so keep it!) and typing sudo make uninstall

Refresh cache /etc/ld.so.cache

sudo ldconfig

Symlink the binaries to the /usr/bin directory

sudo ln -s /usr/local/bin/pdftotext /usr/bin/pdftotext
sudo ln -s /usr/local/bin/pdftoppm /usr/bin/pdftoppm
sudo ln -s /usr/local/lib/libpoppler.so.64 /usr/lib/libpoppler.so.64
@tertek
Copy link
Author

tertek commented Jun 29, 2022

Adjusted settings to newest version 22.06.0

@tertek
Copy link
Author

tertek commented Jun 29, 2022

If cc fails use g++ to compile project file.
Also use sudo ldconfig to reset library config.

@tertek
Copy link
Author

tertek commented Jun 29, 2022

Removed -DENABLE_BOOST=OFF from cmake since we added libboost-all-dev as a dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment