PDFium Delphi Component Docs

HasPermission method

Component: TPdf  ·  Unit: PDFium
Test whether the document grants one particular permission

Syntax

function HasPermission(Permission: TPdfPermission): Boolean;

PermissionTPdfPermission. One of permPrint, permModify, permCopy, permAnnotate, permFillForms, permAccessibility, permAssemble, permPrintHighQuality
ResultBoolean. True when the document grants it

Description

A single-permission form of GrantedPermissions, intended for the common case of gating one operation - enabling a Print command, refusing an extract

The answer comes from the permission bits of the document. PDF permissions are a statement of intent that a conforming viewer honours; they are not enforced by encryption, so an application that must restrict an action still has to do so itself

When the document was opened with the owner password, UserHasPermission reports what a user-password reader would have been allowed instead

See Also

GrantedPermissions, UserHasPermission, Permissions, Password