5

After opening a .pdf file with Adobe Acrobat, go through menu File->Properties->Description tab, we can see the fields such as Author, Subject, Title, Keywords etc. If the .pdf file is created with LaTeX in the usual way, these fields are editable. How could we prevent this? For example, I have seen some .pdf files with these fields uneditable (grayed out). Maybe they are created with other softwares. Does LaTeX offer such functionality?

I know maybe I can use Adobe Acrobat to post-process the .pdf file generated by LaTeX, using password to add some restrictions. However, I don't quite need password protection. I just don't want someone else to change the Author field. And I want to have it all set up in LaTeX itself.

After looking at another thread, I found the solution: Use PDFtk(www.pdflabs.com). I only tried its Windows version. The Windows version comes with 3 kinds: PDFtk Free(GUI, free, limited functions cannot encrypt/decrypt), PDFtk Pro(GUI, not free, unlimited functions), PDFtk Server(command line, free, unlimited functions). I recommand the command line version.

For example:

pdftk unsecured.pdf output secured.pdf owner_pw abcd1234

will generate the file secured.pdf from the original file unsecured.pdf, and secured.pdf is encrypted with the owner password (please distinguish between owner password and user password) "abcd1234". By default it encrypts everything. However, it seems that whitespace is not allowed in the password.

gyou
  • 51
  • Additionally, as LaTeX users, how do you usually deal with security issues concerning the pdf files generated by LaTeX?(if you are really concerned with it) – gyou Feb 10 '14 at 16:26
  • 1
    Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – jub0bs Feb 10 '14 at 16:42
  • Maybe something in http://ctan.org/pkg/pdfcrypt? (Not sure about this.) – cfr Feb 10 '14 at 16:53
  • @cfr, its manual shows that it's only for old version pdftex. I'm using xelatex or pdflatex. – gyou Feb 10 '14 at 16:59
  • 1
    The hyperref package allows one to set these values (which is why I use hyperref for every PDF on my web site). – John Kormylo Feb 10 '14 at 20:14
  • @JohnKormylo, of course I know we can use hyperref package to set those metadata. But my question here is: how to protect these values from being edited by other people after the pdf file is generated. i.e. my desired effect is: When checking the pdf properties in Adobe, these fields are grayed out. – gyou Feb 10 '14 at 20:40
  • Worse, when I tried to use Acrobat to set password protection I got a 110 error on closing. – John Kormylo Feb 10 '14 at 21:10
  • Short answer: No. – Martin Schröder Feb 11 '14 at 11:09

0 Answers0