Skip to main content

TdxPDFDocument.PasswordAttemptsLimit Property

Specifies the number of allowed attempts to enter the document’s protection password.

Declaration

property PasswordAttemptsLimit: Integer read; write;

Property Value

Type Description
Integer

The number of allowed attempts to enter the loaded document’s user or owner password. If the property value is 0, the number of attempts is unlimited.

Remarks

A LoadFromFile or LoadFromStream procedure call invokes the “Enter Password“ dialog for a PDF document protected with a password.

The Enter Password Dialog Form

If a user specifies an incorrect user or owner password required to decrypt the protected document, the “Enter Password“ dialog reopens to allow the user another attempt. The PasswordAttemptLimit property limits the number of times the Enter Password dialog can appear per LoadFromFile or LoadFromStream call. The EdxPDFEncryptionException exception is raised once the last allowed attempt to enter a password fails.

The Exception Message

Note

You can handle the OnGetPassword event to enter a password programmatically and disable the “Enter Password“ dialog.

The PasswordAttemptsLimit property’s default value is the dxPDFDefaultPasswordAttemptsLimit global constant.

See Also