My questions is very simple. How can I set security setting for a PDF file created with PDFLatex?
I should set some password or print permissions, etc.
My questions is very simple. How can I set security setting for a PDF file created with PDFLatex?
I should set some password or print permissions, etc.
This answer, taken partially verbatim from Digital signature on TeX.SX:
Using the PDF Toolkit you can specify a separate owner and user password. Owner passwords are required when changing document properties, while user passwords may be required for performing certain actions, like printing. However, only specifying an owner password and allowing printing by default, would allow users of the document to view/read/print without authentication. You would need the following command line execution:
pdftk input.pdf output output.pdf owner_pw foo allow printing
The above commands takes as input input.pdf, sets the owner password to foo and would allow printing by any user. Modification of document settings require the owner password. See the documentation/man page and examples for more information.
As pdftk is no longer easily available for certain Linux distributions (or no longer easy to keep track of what is going on), another option is qpdf. Password protection is possible. The basic syntax is:
qpdf infile.pdf --encrypt <userpwd> <ownerpwd> <key length> [ restrictions ] outfile.pdf
Where,
<userpassword> and <ownerpassword> may be empty stringskey length may be 40, 128, or 256 and the higher the value the more restrictions one can impose on the use of the pdf. For example,
qpdf infile.pdf --encrypt usr own 128 --print=none -- outfile.pdf
should prevent unauthorized printing.