Hi I am using following code to apply security to the pdf document. The generated pdf has the security as attached. Please suggest what is wrong in the code.
Aspose.Pdf.Kit.DocumentPrivilege pdfPrevilege = Aspose.Pdf.Kit.DocumentPrivilege.ForbidAll;
//pdfPrevilege.AllowPrint = !_documentExportConfiguration.PdfSecuritySetting.IsPrintingAllowed;
//pdfPrevilege.AllowModifyContents = !_documentExportConfiguration.PdfSecuritySetting.IsChangeDocument;
//pdfPrevilege.AllowScreenReaders = !_documentExportConfiguration.PdfSecuritySetting.IsSelectTextGraphics;
//pdfPrevilege.AllowCopy = !_documentExportConfiguration.PdfSecuritySetting.IsSelectTextGraphics;
//pdfPrevilege.AllowAssembly = !_documentExportConfiguration.PdfSecuritySetting.IsSelectTextGraphics;
//pdfPrevilege.AllowFillIn = !_documentExportConfiguration.PdfSecuritySetting.IsAddOrChangeNotes;
//pdfPrevilege.AllowModifyAnnotations = !_documentExportConfiguration.PdfSecuritySetting.IsAddOrChangeNotes;
//pdfPrevilege.AllowModifyContents = !_documentExportConfiguration.PdfSecuritySetting.IsAddOrChangeNotes;
PdfFileSecurity fileSecurity = new PdfFileSecurity(tempFileName, sourceFile);
//Calling EncryptFile method to encrypt the PDF document
fileSecurity.SetPrivilege(userPassword, ownersPassword, pdfPrevilege);