Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to generate a PDF that is not editable?

Currently, the documents I generate using pdflatex may be edited with applications such as Adobe Acrobat X Pro.

I have some PDF documents which cannot be edited with Acrobat, so, how can I reproduce this with LaTeX?

share|improve this question

migrated from tex.stackexchange.com Oct 16 '12 at 7:42

This question came from our site for users of TeX, LaTeX, ConTeXt, and related typesetting systems.

    
One way would be to generate images (ex png), and then create the PDF from the images. –  Peter Grill Oct 4 '12 at 17:13
2  
A lot of the points in the answers here are covered by previous posts in the drm tag. Perhaps take a look at those. –  Joseph Wright Oct 4 '12 at 19:24

2 Answers 2

The PDF Toolkit is a free, command line application that provides this functionality. You set the "owner password" (owner_pw <password>) and specify which properties are allowed for the document. Here's an example (from the Pdftk Examples page) that encrypts the document with 128-Bit Strength and allows printing only:

pdftk mydoc.pdf output mydoc.128.pdf owner_pw foopass allow printing

It yields the following Document Properties in Adobe:

enter image description here

Other permissions can be set as well (from the Pdftk Man page):

[ allow < permissions > ]

Permissions are applied to the output PDF only if an encryption strength is specified or an owner or user password is given. If permissions are not specified, they default to ’none,’ which means all of the following features are disabled.

The permissions section can include one or more of the following features:

  • Printing – Top Quality Printing
  • DegradedPrinting – Lower Quality Printing
  • ModifyContents – Also allows Assembly
  • Assembly
  • CopyContents – Also allows ScreenReaders
  • ScreenReaders
  • ModifyAnnotations – Also allows FillIn
  • FillIn
  • AllFeatures – Allows the user to perform all of the above, and top quality printing.

As it turns out, these security features is very much viewer dependent and there are ways around it.

share|improve this answer
    
Is it robust? Most of the time these restrictions are easy to circumvent by converting to post script and back to pdf. –  Alfred M. Oct 4 '12 at 18:06
    
@AlfredM.: I have not checked. Have you? –  Werner Oct 4 '12 at 18:28
    
no, I was just curious. –  Alfred M. Oct 4 '12 at 18:43
3  
@ Alfred M.: Any solution of this kind is not robust per definition. Indeed, if one can see the content of a PDF file, he can also save it in another PDF/PS/... file. It is just a question of finding the right tools (Acrobat will refuse to do so not because it cannot but because Adobe does not want it to do so). –  amorua Oct 4 '12 at 19:07
    
The DRM applied here is weak, but still strong enough to keep honest people honest. As long as your expectations are tuned accordingly, it is robust enough. Think of it as a contract between the document producer and PDF consuming software. Compliant software will respect the contract and thus act according to the restrictions listed. Adobe, as the originator of PDF, naturally faithfully follows the contract. However, under the hood, all DRM is fatally flawed and depends on arbitrary law such as the DMCA to prevent users from subverting it. –  RBerteig Oct 4 '12 at 23:55

I will add this as an answer, because it answers the question somehow and it is long and a bit complicated. The short answer is: no, it is not possible. Once you can read the PDF on your screen, it means that there's all the information and the PDF can be edited. Adobe programs of course do not offer such functionality. But if you want the PDF to be editable, you can always use ImageMagick:

convert -density 600 myfile.pdf myfile.png

Afterwards, since the quality is very high, any sufficiently good OCR will be able to convert it back to text. And there are surely other possibilites. As was mentioned by the other people, you can decode the PDF to PS (which is possible because to some extent, this is what the PDF reader has to do) and then convert back, and you have an editable PDF file.

Conclusion: You can protect the PDF from edits by "normal" users, but you cannot protect it from edits by people who know what they are doing.

share|improve this answer
    
Even "normal" users can print (if allowed) to PDF. –  Qrrbrbirlbel Oct 4 '12 at 19:28
    
There are methods that makes the PDF print a completely black page for the normal user. I know that some scientific journals do it to allow people to see the article, but not to print it. Still, even this can be cracked, it's the same as making it "non-editable". –  tohecz Oct 4 '12 at 19:33
    
@tohecz : I'm sure you're right; but I find the idea of a "non-printable pdf" both amusing and tragic. Bit like having a program you can't execute. If it's not for printing, pdf is an awful format for anything else. –  Brent.Longborough Oct 5 '12 at 8:21
    
@Brent.Longborough I cannot agree I think. It is portable (i.e. working on all platforms including xindles) and it's well scalable. And it's what people like the most when they want a "document". –  tohecz Oct 5 '12 at 10:44
1  
@Qrrbrbirlbel : It was so named by its creator, Adobe. Not my idea of a reference model for absolute truth. "Portable" is a corporate-speak buzzword, for selling ideas to pointy-haired managers. –  Brent.Longborough Oct 5 '12 at 17:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.