Welcome Guest Search | Active Topics | Sign In | Register

EO.PDF remove PDF password Options
Gabe
Posted: Friday, May 6, 2016 11:39:40 AM
Rank: Member
Groups: Member

Joined: 5/4/2016
Posts: 19
Our FAX service sends us encrypted faxes that require a FAX to open. We would like to use EO.PDF to remove the password during an upload process in our system. Here is the code I'm using to accomplish this...

var pdfkey = new EO.Pdf.PdfDocumentSecurity("Test1234");

var authdoc = new EO.Pdf.PdfDocument(new System.IO.MemoryStream(this.fuform.FileBytes),pdfkey);
authdoc.Security.OwnerPassword = "";
authdoc.Security.UserPassword = "";

var ds = new System.IO.MemoryStream();
authdoc.Save(ds);

...code to upload in to our database

Now I have an issue and a question...

1.) When creating the EO.Pdf.PdfDocument an "invalid password" exception is thrown even though the password is correct.
2.) Assuming we get around #1, what is the proper way to remove the password/encryption? Is it just to empty the passwords and call save as I have done in the above code?

I'm going to send you an example PDF to the support email. Thanks for your help resolving this!
eo_support
Posted: Friday, May 6, 2016 12:39:58 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Thanks for the test file. The reason that it fails is because it uses AES encryption which we do not support yet. We are in the process of adding this though. So hopefully we will be able to support this file in the near future. We will reply again as soon as support to this is added.
eo_support
Posted: Saturday, May 14, 2016 6:38:50 PM
Rank: Administration
Groups: Administration

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

Please download .86 build from our download page. This build added AES support and should work with your file properly.

Thanks!
Gabe
Posted: Monday, May 16, 2016 11:44:59 AM
Rank: Member
Groups: Member

Joined: 5/4/2016
Posts: 19
I have verified the new build correctly reads AES encrypted PDF files. Thanks again for the quick turnaround!

Some follow-up questions...
1.) What is the proper way to remove encryption from a PDF file when saving? Is the procedure like my code example above to simple set the passwords to empty strings? This seems to work but I wanted to make sure this is the proper way.
2.) Conversely, when encrypting a file with a password, what is the default encryption method is used by EO.Pdf? Is there a way to specify which algorithm is used?
eo_support
Posted: Monday, May 16, 2016 2:50:34 PM
Rank: Administration
Groups: Administration

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

In order to remove the password, you would need to load the PdfDocument with the current password, then explicitly set the PdfDocument.Security.UserPassword and OwnerPassword to null, then save the document.

Currently there is no way to specify the encryption method since we still do not support generating AES encrypted files. Only reading AES encrypted files is implemented in the current build.

Thanks!


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.