getPermissions
Get the permission word from an input PDF file.
getPermissions([in] LONG inputHandle, [out, retval] int *permissions)
This function returns the permission word from an input PDF file.
The return value from this function is only valid if
isEncrypted
returned non-zero.
The perm*
properties can be used to test various
permission bits:
permPrint
: printingpermModify
: general modificationpermCopy
: copy/extract text and graphicspermAnnotate
: add annotationspermFormFill
: fill form fieldspermAccessibility
: extract text and graphics for accessibilitypermAssemble
: assemble the documentpermPrintHQ
: high-quality printing
Note that all of the permission bit constants are read-only properties
on the COM component, so you'll need to
use pdf.permPrint
, etc.
VB6:
Dim in as Long
in = pdf.openInput("c:/test/file.pdf")
If pdf.isEncrypted(in) Then
permissions = pdf.getPermissions(in)
If (permissions And pdf.permPrint) = 0 Then
' not allowed to print
End If
}
VB.net:
Dim in as Long
in = pdf.openInput("c:/test/file.pdf")
If pdf.isEncrypted(in) Then
permissions = pdf.getPermissions(in)
If (permissions And pdf.permPrint) = 0 Then
' not allowed to print
End If
}