Skip to content

Instantly share code, notes, and snippets.

@Dayjo
Last active February 21, 2025 19:43
Show Gist options
  • Save Dayjo/618794d4ff37bb82ddfb02c63b450a81 to your computer and use it in GitHub Desktop.
Save Dayjo/618794d4ff37bb82ddfb02c63b450a81 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++ autoconf libfontconfig1-dev pkg-config libjpeg-dev libopenjpeg-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.7.tar.gz

Extract (it does untar cleanly):

tar -xf poppler-data-0.4.7.tar.gz

Enter the directory

cd poppler-data-0.4.7

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-0.48.0.tar.xz
tar -xf poppler-0.48.0.tar.xz
cd poppler-0.48.0

Now run the configure file like this:

./configure

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

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
@guimafx
Copy link

guimafx commented Sep 27, 2024

// INSTALL PIP FIRST, e and second POPPLER with Last Version.

apt install python3-pip

pip install python-poppler

@JSHZT
Copy link

JSHZT commented Oct 21, 2024

I use this:

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

but it said: E: Unable to locate package libopenjpeg-dev

@NagisaHere
Copy link

I have no idea where libopenjpeg-dev went, but I omitted it in the install and installed openjpeg from
https://github.com/uclouvain/openjpeg/blob/master/INSTALL.md
(May need to install the additional packages in install.md)

@NagisaHere
Copy link

Now I've just got
`
In file included from /usr/include/glib-2.0/glib.h:43,
from /usr/include/glib-2.0/gobject/gbinding.h:28,
from /usr/include/glib-2.0/glib-object.h:22,
from poppler.h:22,
from poppler-action.cc:19:
/usr/include/glib-2.0/glib/gdate.h:48:17: note: declared here
48 | typedef gint32 GTime GLIB_DEPRECATED_TYPE_IN_2_62_FOR(GDateTime);
| ^~~~~
In file included from /usr/include/glib-2.0/glib/gthread.h:32,
from /usr/include/glib-2.0/glib/gasyncqueue.h:32,
from /usr/include/glib-2.0/glib.h:32,
from /usr/include/glib-2.0/gobject/gbinding.h:28,
from /usr/include/glib-2.0/glib-object.h:22,
from poppler.h:22,
from poppler-action.cc:19:
poppler-action.cc: In function ‘GType poppler_dest_get_type()’:
/usr/include/glib-2.0/glib/gatomic.h:113:19: error: argument 2 of ‘__atomic_load’ must not be a pointer to a ‘volatile’ type
113 | __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST);
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gthread.h:260:7: note: in expansion of macro ‘g_atomic_pointer_get’
260 | (!g_atomic_pointer_get (location) &&
| ^~~~~~~~~~~~~~~~~~~~
poppler-private.h:151:13: note: in expansion of macro ‘g_once_init_enter’
151 | if (g_once_init_enter (&g_define_type_id__volatile)) {
| ^~~~~~~~~~~~~~~~~
poppler-action.cc:28:1: note: in expansion of macro ‘POPPLER_DEFINE_BOXED_TYPE’
28 | POPPLER_DEFINE_BOXED_TYPE (PopplerDest, poppler_dest, poppler_dest_copy, poppler_dest_free)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
poppler-action.cc: In function ‘GType poppler_action_get_type()’:
/usr/include/glib-2.0/glib/gatomic.h:113:19: error: argument 2 of ‘__atomic_load’ must not be a pointer to a ‘volatile’ type
113 | __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST);
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gthread.h:260:7: note: in expansion of macro ‘g_atomic_pointer_get’
260 | (!g_atomic_pointer_get (location) &&
| ^~~~~~~~~~~~~~~~~~~~
poppler-private.h:151:13: note: in expansion of macro ‘g_once_init_enter’
151 | if (g_once_init_enter (&g_define_type_id__volatile)) {
| ^~~~~~~~~~~~~~~~~
poppler-action.cc:96:1: note: in expansion of macro ‘POPPLER_DEFINE_BOXED_TYPE’
96 | POPPLER_DEFINE_BOXED_TYPE (PopplerAction, poppler_action, poppler_action_copy, poppler_action_free)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
make[4]: *** [Makefile:751: libpoppler_glib_la-poppler-action.lo] Error 1
make[4]: Leaving directory '/home/yippee/Documents/poppler-0.48.0/glib'
make[3]: *** [Makefile:945: all-recursive] Error 1
make[3]: Leaving directory '/home/yippee/Documents/poppler-0.48.0/glib'
make[2]: *** [Makefile:605: all] Error 2
make[2]: Leaving directory '/home/yippee/Documents/poppler-0.48.0/glib'
make[1]: *** [Makefile:653: all-recursive] Error 1
make[1]: Leaving directory '/home/yippee/Documents/poppler-0.48.0'
make: *** [Makefile:536: all] Error 2

`

@starfishthestarfish
Copy link

Try installing them one by one so you only focus on the ones with errors.

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