Welcome Guest Search | Active Topics | Sign In | Register

Programatically Open Password Protected File Options
BobR
Posted: Thursday, January 5, 2012 12:42:59 PM
Rank: Newbie
Groups: Member

Joined: 1/5/2012
Posts: 2
I have written the code to create a password protected PDF. How would I Open this PDF without prompting for the Password?

doc.Security.UserPassword = "1234"
doc.Save

Doc.OPEN???

I know I can use

Process.Start (File_Name)

But that prompts a for password.

Thanks in advance
eo_support
Posted: Thursday, January 5, 2012 1:19:55 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You can open the PDF file with our library by supplying the correct password this way:

Code: C#
PdfDocumentSecurity security = new PdfDocumeentSecurity("1234");
        

//Load the PDF file with the given password
PdfDocument doc = new PdfDocument(pdfFileName, security);

However we have no way of controlling the behavior of Adobe Reader (or whatever other PDF viewer you have). So when you put a password on the file, they will faithfully ask for a password. That's the whole purpose of putting a password on the file.

Thanks!
BobR
Posted: Thursday, January 5, 2012 1:56:17 PM
Rank: Newbie
Groups: Member

Joined: 1/5/2012
Posts: 2
I purchased the product and I recieved the activation code. Do I need to invoke that code in every instance that I use the EO.PDF object?

Can I just reference it once at startup?
eo_support
Posted: Thursday, January 5, 2012 1:58:38 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
No no no. Just reference it at startup before you call any of our code.

Thank you very much for your business!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.