We're looking for something like this:
Code: Select all
private bool IsDocumentSecured(int docId)
{
_viewer.GetDocumentProperty(docId, "Document.Security", out var isSecured);
return (int) isSecured == 1;
}
Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Code: Select all
private bool IsDocumentSecured(int docId)
{
_viewer.GetDocumentProperty(docId, "Document.Security", out var isSecured);
return (int) isSecured == 1;
}
Code: Select all
public bool IsDocumentSecured(int docId) {
// For now we assume the document is secured if the Delete Page operation is not granted.
// We asked a forum question here that might surface a better approach.
// https://forum.pdf-xchange.com/viewtopic.php?f=36&t=30839&p=123742#p123742
return !IsOperationGranted(docId, ObjectIdentifier.Page, OperationIdentifier.Delete);
}
public bool IsOperationGranted(int documentId, ObjectIdentifier objectId, OperationIdentifier operationId) {
var dataIn = new object[] {
(int) objectId,
(int) operationId
};
_viewer.DoDocumentVerb(documentId, null, "IsOperationGranted", dataIn, out var isGranted);
return (int) isGranted == 1;
}