In the following code "SetPrivilege" is throwing exception.
Workbook workbook = new Workbook();
string filename = @"C:\Temp\Untitled\CPS_files\Sample_1.xlsx";
string outputFile = @"C:\Temp\Untitled\CPS_files\Sample_2.pdf";
workbook.Open(filename);
MemoryStream inputStream = workbook.SaveToStream();
MemoryStream outputStream = new MemoryStream();
outputStream.Seek(0, SeekOrigin.Begin);
Aspose.Cells.SaveOptions option = workbook.SaveOptions;
option.SaveFormat = SaveFormat.Pdf;
inputStream.Seek(0, SeekOrigin.Begin);
outputStream.Seek(0, SeekOrigin.Begin);
PdfExtractor ext = new PdfExtractor();
PdfFileSecurity fileSecurity = new PdfFileSecurity(inputStream, outputStream);
//fileSecurity.ChangePassword(null, "B", "B");
fileSecurity.SetPrivilege("userPassword","ownerPassword", DocumentPrivilege.AllowAll);
FileStream fs = new FileStream(outputFile,FileMode.CreateNew);
StreamReader rs = new StreamReader(outputStream);
fs.Write(outputStream.ToArray(),0, (int)outputStream.Length);
fs.Close();