Unable to set a user password only to open PDF

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
Maestro
Posts: 20
Joined: Thu Jun 30 2005

Unable to set a user password only to open PDF

Post by Maestro »

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
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

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
Maestro
Posts: 20
Joined: Thu Jun 30 2005

Post by Maestro »

Thanks for your reply.
It works fine now

Benoit Tremblay
Post Reply