Free Support Forum - aspose.com

How to check in pdf that content copying for accessibility exists or not?

How to check in pdf that content copying for accessibility exists or not?

@kranthireddyr

Thanks for your inquiry.

In order to check whether a PDF document security allows copying or not, please access DocumentPrivilege.AllowCopy property while using following code snippet:

// Instantiate PdfFileInfo Class object.
Aspose.Pdf.Facades.PdfFileInfo info = new Aspose.Pdf.Facades.PdfFileInfo();
// Load your encrypted PDF document.
info.BindPdf(dataDir + "EncryptedDocument.pdf");
// Get DocumentPrivilege
Facades.DocumentPrivilege documentPrivilege = info.GetDocumentPrivilege();
// Determine AllowCopy
bool copyingContent = documentPrivilege.AllowCopy;

In event of any further query, please feel free to contact us.