...making Linux just a little more fun!
Neil Youngman [ny at youngman.org.uk]
Some time ago I came across PDFTK, but I've never really had a use for it. it sounds as though it should do what you need, but a quick scan of the man page doesn't tell me whether it honours restrictions in the PDF.
Ben Okopnik [ben at linuxgazette.net]
On Tue, Nov 02, 2010 at 03:02:41PM +0000, Neil Youngman wrote:
> Some time ago I came across PDFTK, but I've never really had a use for it. it > sounds as though it should do what you need, but a quick scan of the man page > doesn't tell me whether it honours restrictions in the PDF. > > http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
ben at Jotunheim:/tmp$ pdfinfo restricted.pdf Title: restricted-test.rtf Author: Cnl Creator: ADOBEPS4.DRV Version 4.50 Producer: Acrobat Distiller 5.0 CreationDate: Fri Jul 19 02:11:24 2002 ModDate: Thu Jul 18 19:12:43 2002 Tagged: no Pages: 8 Encrypted: yes (print:no copy:no change:no addNotes:no) Page size: 612 x 792 pts (letter) File size: 49879 bytes Optimized: yes PDF version: 1.4 ben at Jotunheim:/tmp$ pdftk restricted.pdf cat 3-4 output pages3-4.pdf Error: Failed to open PDF file: restricted.pdf OWNER PASSWORD REQUIRED, but not given (or incorrect) Errors encountered. No output created. Done. Input errors, so no output created.
However, as I'd mentioned in the editorial note, there are several trivial ways to remove that "protection", and these have been available for years - after which, pdftk will do literally anything you can think of to the content. The "protection" is a rather silly toy, and I'm not sure what use it was supposed to be (although the "copy" protection isn't quite as silly as it sounds - I think it means "don't allow selecting the text to be pasted elsewhere". In any case, both evince and xpdf ignore it.)
-- * Ben Okopnik * Editor-in-Chief, Linux Gazette * http://LinuxGazette.NET *