Free Support Forum - aspose.com

Using PdfFileSecurity.SetPrivilege

I want to allow the DocumentPrivilege.Print and the DocumentPrivilege.ScreenReaders.

What is the proper coding for allowing both? I see the command works for setting a single privilege.

PdfFileSecurity pdfSecurity = new PdfFileSecurity(inputStream, outputStream);

pdfSecurity.SetPrivilege("", "", DocumentPrivilege.Print);

Do I call the command multiple times?

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. As I can see you are using Aspose.Pdf.Kit to set security settings of your PDF documents. So I will move your request to the appropriate forum. My colleagues from Aspose.Pdf.Kit team will answer you shortly.

Best regards,

Hi James,

You can set multiple values using pipe sign ( | ) in C# (and by using Or in Visual Basic) as shown blow:


fileSecurity.SetPrivilege("", “”, DocumentPrivilege.Print | DocumentPrivilege.ScreenReaders);

I hope this helps. If you have any further questions, please do let us know.
Regards,