Hi,
I use the PDF converter 2.5 pro for a while and I want to add password protection to open the generated PDF. Here is my lines of code (in VB)
...
PDFPrinter.Permissions = -64 + 4 '+ 16 + 32
PDFPrinter.FileNameOptionsEx = 1 + 2 + 256
PDFPrinter.OwnerPassword = "password"
PDFPrinter.UserPassword = "clientpassword"
...
With these lines, the document is password protected but not for opening. The user can open it but he can't print!! I want the user to be prompted before opening the document and let him print!
What I do wrong?
Thanks
Unable to set a user password only to open PDF
You need to call SetDefaultConfig after changing the security settings otherwise the calling application will not take these settings into account.
PDFPrinter.Permissions = -64 + 4 '+ 16 + 32
PDFPrinter.FileNameOptionsEx = 1 + 2 + 256
PDFPrinter.OwnerPassword = "password"
PDFPrinter.UserPassword = "clientpassword"
PDFPrinter.SetDefaultConfig
PDFPrinter.Permissions = -64 + 4 '+ 16 + 32
PDFPrinter.FileNameOptionsEx = 1 + 2 + 256
PDFPrinter.OwnerPassword = "password"
PDFPrinter.UserPassword = "clientpassword"
PDFPrinter.SetDefaultConfig