Check for Adobe Policy Setting in PDF

Q:
We are trying to validate if a PDF document has Adobe policy settings enabled using the PDFTron API. Is there an API that we can use to detect the existence of a policy setting on a given PDF file?

A:

I am not exactly sure what you mean with ‘Adobe policy settings’, however in case you are looking how Acrobat Pro tags PDF (so that they can be manipulated in ‘free’ Reader), this info is stored as a signature in ‘Perms’ dictionary.

You can access the info as follows:

Obj p = pdfdoc.GetRoot().FindObj(“Perms”);

if (p != null) {

// Check for the ‘Rights’ dict…

Obj rights = p.FindObj(“UR”);

// Maybe erase p.Erase(“UR”); etc.

}