Permissions test = (Permissions)document.Permissions;
Page extraction option is not able to be set by user. To allow this feature user needs to remove security from the file completely. There is a link that describes how to extract pages.
Also please note that Pdf reference does not provide single page extraction permission flag. The Page extraction is always set to Not allowed while encrypted document is opened without Owner password. Actually encryption allows you to remove permissions compared to what is allowed for an unencrypted document. You get the maximum number of permissions by simply not encrypting the document. Also please keep in mind what Acrobat Reader does not offer the full functionality (in this case - page extraction), so the data of Security tab may be different against Adobe Pro.
By the way, following code snippet can be used to extract PrintDocument permissions.
Permissions test = (Permissions)document.Permissions;<o:p></o:p>
if ((test & Permissions.PrintDocument) == Permissions.PrintDocument)
// Document has PrintDocument permission<o:p></o:p>
Hi i have written the below code but for test.pdf it returns true & for test2.pdf it is returning false even though both the documents have page extraction as not allowed. what could be the issue.
password for both the files is 123
test.pdf (52.1 KB)
test2.pdf (52.3 KB)
boolean ExtractPageAllowed = (pdfDocument.getPermissions() & (Permissions.ExtractContent)) == Permissions.ExtractContent;