The following question and answer on StackOverflow show how to generate a PDF that cannot be opened without the appropriate password.
Password protected PDF using C#
I would like to use this framework similarly, but slightly altered to allow my users to "open" the PDF without needing the password, but only allow them to EDIT the PDF if they have the password.
Is that possible with iTextSharp?
if this matters, I am working in C# 4.0 within a WF 4.0 custom activity.
Best Answer
Yes, there are two passwords that you can pass to
PdfEncryptor.Encrypt()
,userPassword
andownerPassword
. Just passnull
to theuserPassword
and people will be able to open it without specify a password.