{"id":3926,"date":"2018-11-20T20:57:43","date_gmt":"2018-11-20T20:57:43","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=3926"},"modified":"2018-12-07T02:52:13","modified_gmt":"2018-12-07T02:52:13","slug":"install-pdftk-on-ubuntu-linux-hint","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/11\/20\/install-pdftk-on-ubuntu-linux-hint\/","title":{"rendered":"Install PDFtk on Ubuntu | Linux Hint"},"content":{"rendered":"<p>PDF is an integral part of our everyday life. It\u2019s a document format that\u2019s trusted by every single platform. Often times, important documents and books are in PDF format. It\u2019s so widespread that without an appropriate PDF tool at hand, no system is complete. Ubuntu offers a great flexibility in terms of software availability. It\u2019s also one of the most popular Linux distros for being so simple yet powerful and fast, extremely suitable for new to moderate Linux users. Let\u2019s grab PDFtk \u2013 the ultimate PDF toolkit you\u2019ll ever need!<\/p>\n<p>There are 2 versions of PDFtk available \u2013 Free, Pro ($3.99) and Server. The Pro version offers all the additional features like rotating the PDF, stamping etc. The Server version is the command-line utility for performing various tasks.<\/p>\n<p>PDFtk is available in the default Ubuntu software repository. However, on the latest Ubuntu releases, it\u2019s not accessible directly. You have to use a little trick to get in on your system.<\/p>\n<h2>Method 1<\/h2>\n<p>Run the following commands \u2013<\/p>\n<p>sudo add-apt-repository ppa:malteworld\/ppa<br \/>\nsudo apt update<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"\" width=\"1062\" height=\"592\" \/><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"\" width=\"1060\" height=\"738\" \/>Method 2<\/p>\n<p>You can also download and build PDFtk by yourself. For doing so, you need the Java build tools and dependencies.<\/p>\n<p>Run the following commands \u2013<\/p>\n<p>sudo apt install default-jre-headless libcommons-lang3-java libbcprov-java<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"\" width=\"1060\" height=\"738\" \/><\/p>\n<p>sudo apt install git default-jdk-headless ant<br \/>\nlibcommons-lang3-java libbcprov-java<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"\" width=\"731\" height=\"509\" \/><\/p>\n<p>git clone https:\/\/gitlab.com\/pdftk-java\/pdftk.git<\/p>\n<p>cd pdftk<br \/>\nmkdir libs<br \/>\nln -st libs \/usr\/share\/java\/.jar<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"\" width=\"736\" height=\"189\" \/><\/p>\n<p>ant jar<br \/>\njava -jar build\/jar\/pdftk.jar &#8211;help<\/p>\n<p>Method 3 (recommended)<\/p>\n<p>Install the PDFtk snap \u2013<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"\" width=\"1061\" height=\"175\" \/><\/p>\n<p>Note that this is the \u201cServer\u201d version of PDFtk.<\/p>\n<h3>Using PDFtk<\/h3>\n<p>After the installation is complete, check out the app working perfectly \u2013<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"\" width=\"736\" height=\"371\" \/><\/p>\n<p>In fact, running this command will show a short guide you can use. For the long, in-depth guide, run the following command \u2013<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"\" width=\"731\" height=\"509\" \/><\/p>\n<p>For checking out the guide later, export it to a text file \u2013<\/p>\n<p>pdftk &#8211;help &gt; ~\/Desktop\/pdftk.txt<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"\" width=\"942\" height=\"505\" \/><\/p>\n<p>Here are some of the most used tasks you can do with PDFtk.<\/p>\n<h3>Encrypt a PDF (128-bit encryption)<\/h3>\n<p>pdftk dummy.pdf output dummy.128.pdf owner_pw foo user_pw 123<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"\" width=\"916\" height=\"499\" \/><\/p>\n<h3>Decrypt a PDF<\/h3>\n<p>pdftk dummy.128.pdf input_pw 123 output dummy.unsecured.pdf<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"\" width=\"919\" height=\"499\" \/><\/p>\n<h3>Join multiple PDFs into one<\/h3>\n<p>pdftk dummy1.pdf dummy2.pdf cat output dummy_merged.pdf<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"\" width=\"727\" height=\"233\" \/><\/p>\n<p>You can also use wildcard \u2013<\/p>\n<p>pdftk *.pdf cat output combined.pdf<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"\" width=\"918\" height=\"467\" \/><\/p>\n<h4>Rotate PDF document (must be 1 page document)<\/h4>\n<p># 90\u00b0 clockwise rotate<\/p>\n<p>pdftk dummy.pdf<\/p>\n<p>cat<\/p>\n<p>1east<\/p>\n<p>2<\/p>\n<p>-end output dummy_90.pdf<\/p>\n<p># 180\u00b0 rotate<br \/>\npdftk dummy.pdf cat 1-endsouth output dummy_180.pdf<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/image\/gif;base64,R0lGODdhAQABAPAAAP\/wAAACwAAAAAAQABAEACAkQBADs=\" alt=\"\" width=\"919\" height=\"504\" \/><\/p>\n<p>Enjoy!<\/p>\n<p><a href=\"https:\/\/linuxhint.com\/install_pdftk_ubuntu\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PDF is an integral part of our everyday life. It\u2019s a document format that\u2019s trusted by every single platform. Often times, important documents and books are in PDF format. It\u2019s so widespread that without an appropriate PDF tool at hand, no system is complete. Ubuntu offers a great flexibility in terms of software availability. It\u2019s &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/11\/20\/install-pdftk-on-ubuntu-linux-hint\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Install PDFtk on Ubuntu | Linux Hint&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3926","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/3926","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=3926"}],"version-history":[{"count":2,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/3926\/revisions"}],"predecessor-version":[{"id":4670,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/3926\/revisions\/4670"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=3926"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=3926"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=3926"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}