Removing Pdf Security

Hi,

I have two questions:

1. I was trying to execute following code on the attached pdf:
public void AllowAll()
{
AsposeTests.LicenseManager.Initialize();

string inFile = Server.MapPath(“encrypted.pdf”);
string outFile = Server.MapPath(“example2.pdf”);

//Instantiating PdfFileSecurity object
PdfFileSecurity fileSecurity = new PdfFileSecurity(inFile, outFile);

//Call SetPrivilege method
DocumentPrivilege privilege = DocumentPrivilege.AllowAll;
fileSecurity.SetPrivilege(privilege);
}

After I run this code, I see no change in document restriction summary of the pdf.
If I use:
DocumentPrivilege privilege = DocumentPrivilege.ForbidAll;
I see everything set to 'Not Allowed" setting. How do I allow all features.

2. How can I remove the document security of the pdf totally?

Thanks,
Uday


Hi Uday,

We’ll look into your requirement in detail and update you with the results of the investigation the earliest possible.

We’re sorry for the inconvenience.
Regards,

Hi Uday,

I have tested this issue at my end and I would like to share with you that in order to remove all the privileges and security you may use DecryptFile method without any password as shown below:


fileSecurity.DecryptFile("");

Although, some privileges, in Adobe Reader, are shown to be not allowed, however, in the Adobe Acrobat you can see that all privileges are allowed and this document is editable in any way.

I hope this resolves your issue; however, if you still find any problem or questions, please do let us know.
Regards,

Thank you, DecryptFile is working to disable encryption.