Skip to content

Instantly share code, notes, and snippets.

@njeffers
Last active November 26, 2019 19:13
Show Gist options
  • Save njeffers/1ab321ff6761d70b90a649d6b1095e4a to your computer and use it in GitHub Desktop.
Save njeffers/1ab321ff6761d70b90a649d6b1095e4a to your computer and use it in GitHub Desktop.
Installing PDFtk, ImageMagik, and PDFJam on Ubuntu 18.04
##Pre 18.04 versions:
sudo apt-get install pdftk
--------------------------
##Ubuntu 18.04 - #credit to abu_bua - see https://askubuntu.com/questions/1028522/how-can-i-install-pdftk-in-ubuntu-18-04-and-later
cd /tmp
wget http://launchpadlibrarian.net/340410966/libgcj17_6.4.0-8ubuntu1_amd64.deb \
http://launchpadlibrarian.net/337429932/libgcj-common_6.4-3ubuntu1_all.deb \
https://launchpad.net/ubuntu/+source/pdftk/2.02-4build1/+build/10581759/+files/pdftk_2.02-4build1_amd64.deb \
https://launchpad.net/ubuntu/+source/pdftk/2.02-4build1/+build/10581759/+files/pdftk-dbg_2.02-4build1_amd64.deb
sudo apt-get install ./libgcj17_6.4.0-8ubuntu1_amd64.deb \
./libgcj-common_6.4-3ubuntu1_all.deb \
./pdftk_2.02-4build1_amd64.deb \
./pdftk-dbg_2.02-4build1_amd64.deb
rm ./libgcj17_6.4.0-8ubuntu1_amd64.deb
rm ./libgcj-common_6.4-3ubuntu1_all.deb
rm ./pdftk_2.02-4build1_amd64.deb
rm ./pdftk-dbg_2.02-4build1_amd64.deb
--------------------
##Installing ImageMagick
sudo apt-get install imagemagick
#you may get issues running convert, such as "not authorized `aaaa` @ error/constitute.c/ReadImage/453"
# credits to sNICkerssss - https://stackoverflow.com/questions/42928765/convertnot-authorized-aaaa-error-constitute-c-readimage-453/52715220
In file /etc/ImageMagick-6/policy.xml (or /etc/ImageMagick/policy.xml)
change line
<policy domain="coder" rights="none" pattern="PDF" />
to
<policy domain="coder" rights="read|write" pattern="PDF" />
-------------------------
## Install PDFJam
sudo apt install texlive-extra-utils (Needed for pdfjam)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment