Accusoft.PdfXpressSdk Namespace > Document Class : GetSecurity Method |
'Declaration Public Function GetSecurity( _ ByVal ownerPassword As String _ ) As Security
'Usage Dim instance As Document Dim ownerPassword As String Dim value As Security value = instance.GetSecurity(ownerPassword)
public Security GetSecurity( string ownerPassword )
public: Security* GetSecurity( string* ownerPassword )
public: Security^ GetSecurity( String^ ownerPassword )
Exception | Description |
---|---|
PdfXpressException | Security has already been removed or Security has been recently added to the Document, and it must be saved first. |
InvalidOwnerPasswordException | The Owner Password specified is incorrect. Note: If Security Settings are to be modified, once complete the document should be immediately saved and disposed of before being opened again or before the saved document is opened. |
If the Document lacks Security, this returns null. If the Owner Password is incorrect an InvalidOwnerPasswordException will be thrown.
If an Empty String is used for the Owner Password, the Security.IsEditable property should be checked afterwards to determine if the Security settings returned can be modified.
Documents with Security Settings but no actual Owner Password specified are possible, in this case an Empty String should be used as the specified parameter and the Security.IsEditable property should be checked afterwards.
Note: If security can't be modified, then the Owner Password will be unavailable.