|
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!
|
|
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.
|
|
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!
|
|
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?
|
|
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!
|
|