TdxPDFCustomViewer.PasswordAttemptsLimit Property
Specifies the number of allowed attempts to enter the PDF document‘s protection password.
Declaration
property PasswordAttemptsLimit: Integer read; write;
Property Value
Type |
---|
Integer |
Remarks
When an encrypted document is being loaded to the PDF Viewer control, the Enter Password dialog is displayed, prompting an end-user to enter either the user or owner password required to decrypt the document:
The PasswordAttemptsLimit property specifies the number of times the Enter Password dialog can be shown during a single attempt to load a PDF document. If all end-user’s attempts to enter a password have failed, the following error message is displayed:
Failing to enter a proper password during the last allowed attempt does not prevent an end-user from trying to load the same file again by using the OpenDocument command, provided that it is linked to a UI element within your application.
The default number of allowed attempts to enter the document protection password is determined by the dxPDFDefaultPasswordAttemptsLimit global constant. If the PasswordAttemptsLimit property is set to 0, an end-user can attempt to enter the document protection password any number of times.
To provide the required password programmatically, preventing the Enter Password dialog from appearing, handle the OnGetPassword event.
Note
The PasswordAttemptsLimit property is synchronized with the Document.PasswordAttemptsLimit property.