I have attempted to use the GetDocumentPrivilege class and it does not return the correct values. I am using version 3.9 of Aspose.PDF.Kit.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
Here’s the code:
FileStream fs = new FileStream(filePath, FileMode.Open);
PdfFileInfo fi = new PdfFileInfo(fs);
DocumentPrivilege privilege = fi.GetDocumentPrivilege();
StringBuilder sb = new StringBuilder();
sb.AppendLine("AllowAssembly: " + Environment.NewLine + " " + privilege.AllowAssembly.ToString());
sb.AppendLine("AllowCopy: " + Environment.NewLine + " " + privilege.AllowCopy.ToString());
sb.AppendLine("AllowDegradedPrinting: " + Environment.NewLine + " " + privilege.AllowDegradedPrinting.ToString());
sb.AppendLine("AllowFillIn: " + Environment.NewLine + " " + privilege.AllowFillIn.ToString());
sb.AppendLine("AllowModifyAnnotations: " + Environment.NewLine + " " + privilege.AllowModifyAnnotations.ToString());
sb.AppendLine("AllowModifyContents: " + Environment.NewLine + " " + privilege.AllowModifyContents.ToString());
sb.AppendLine("AllowPrint: " + Environment.NewLine + " " + privilege.AllowPrint.ToString());
sb.AppendLine("AllowScreenReaders: " + Environment.NewLine + " " + privilege.AllowScreenReaders.ToString());
lblProperties.Text = sb.ToString();
}
This does not return the correct properties of the file.
I have also tried using the filePath directly with the same results.
The intellisense for the properties do not show them to be get or set, but I do not get any error.
Thanks for your help.