Password-Protected PDF Document
To allow the users to open password-protected documents in the .NET MAUI PDF Viewer, you must handle the SourcePasswordNeeded
event.
-
SourcePasswordNeeded
—Occurs when a user password is needed to load the document in the PDF Viewer. TheSourcePasswordNeeded
event handler receives two parameters:- The sender argument, which is of type
object
, but can be cast to theRadPdfViewer
type. - A
PasswordNeededEventArgs
object, which provides thePassword
property used to supply the user password.
- The sender argument, which is of type
The following example demonstrates how to use the SourcePasswordNeeded
event:
The next code snippet represents the event handler: