We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PDF Properties are changed when using PdfFileSecurity

Open the TBD.pdf and apply the PdfFileSecurity using the code below. Reviewing the properties after the save, the properties have been changed to mixed characters.

private void setSecurity(string path)
var docPrivilege = Aspose.Pdf.Facades.DocumentPrivilege.ForbidAll;
docPrivilege.AllowDegradedPrinting = true;

var fileSecurity = new Aspose.Pdf.Facades.PdfFileSecurity();
fileSecurity.EncryptFile("test", "test2", docPrivilege, Aspose.Pdf.Facades.KeySize.x128, Aspose.Pdf.Facades.Algorithm.AES);
fileSecurity.Save(path + "cleaned.pdf");


Thanks for using our API’s.

I have tested the scenario and I am able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFNEWNET-37581. We will investigate this issue in details and will keep you updated on the status of a correction.

We apologize for your inconvenience.


Please try to use 22.5 version of the API as we were unable to reproduce the issue using the latest version. In case you face any issues, please let us know.