{"id":169,"date":"2014-10-14T14:14:59","date_gmt":"2014-10-14T12:14:59","guid":{"rendered":"http:\/\/www.dolicapax.org\/?p=169"},"modified":"2016-02-24T01:40:19","modified_gmt":"2016-02-24T00:40:19","slug":"fast-track-remove-watermark-from-pdf-on-ubuntu-14","status":"publish","type":"post","link":"https:\/\/www.dolicapax.org\/?p=169","title":{"rendered":"Remove password and watermark from pdf on Ubuntu 14"},"content":{"rendered":"<p>For this recipe we need <em>ghostscript<\/em> which is\/should be installed by default, as well as <em>pdftk<\/em> and <em>xpdf-utils<\/em>:<\/p>\n<pre>apt-get install pdftk\r\nsudo apt-get install xpdf-utils<\/pre>\n<p>If the PDF is encrypted with a password, remove it using <em>xpdf-utils<\/em> and <em>ghostscript:<\/em><\/p>\n<pre>pdftops -upw PASSWORD encrypted.pdf\r\nps2pdf encrypted.ps plaintext.pdf<\/pre>\n<p>Now remove the watermark with <em>sed<\/em> and repair it with <em>pdftk<\/em>, assuming the file name is <em>plaintext.pdf<\/em><\/p>\n<pre><code>sed -e \"s\/THISISTHEWATERMARK\/ \/g\" &lt;plaintext.pdf &gt;nowatermark.pdf &amp;&amp; pdftk nowatermark.pdf output repaired.pdf &amp;&amp; mv repaired.pdf nowatermark.pdf\r\n<\/code><\/pre>\n<p>Resulting in the final\u00a0<em>nowatermark.pdf<\/em> without encryption or watermark<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For this recipe we need ghostscript which is\/should be installed by default, as well as pdftk and xpdf-utils: apt-get install pdftk sudo apt-get install xpdf-utils If the PDF is encrypted with a password, remove it using xpdf-utils and ghostscript: pdftops &hellip; <a href=\"https:\/\/www.dolicapax.org\/?p=169\">Continue reading <span class=\"meta-nav\">&rarr;<\/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":[4,36],"tags":[46,48,8,47],"_links":{"self":[{"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/posts\/169"}],"collection":[{"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=169"}],"version-history":[{"count":7,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/posts\/169\/revisions"}],"predecessor-version":[{"id":172,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/posts\/169\/revisions\/172"}],"wp:attachment":[{"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}