GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / PdfCertificateRequest Event
Example





In This Topic
PdfCertificateRequest Event (GdViewer)
In This Topic
This event is raised if a certificate (digital ID) is required to decrypt the loaded PDF document for display. The event is explicitly raised when the PdfShowOpenFileDialogForDecryption property is set to false.

Please check the corresponded GdViewer.PdfCertificateRequestEventHandler for given parameters.

You are allowed to prompt the user with your own dialog box for entering the certificate file for protected PDF documents using this event.

Syntax
'Declaration
 
Public Event PdfCertificateRequest As GdViewer.PdfCertificateRequestEventHandler
public event GdViewer.PdfCertificateRequestEventHandler PdfCertificateRequest
public event PdfCertificateRequest: GdViewer.PdfCertificateRequestEventHandler; 
In JScript, you can handle the events defined by another class, but you cannot define your own.
public: __event GdViewer.PdfCertificateRequestEventHandler* PdfCertificateRequest
public:
event GdViewer.PdfCertificateRequestEventHandler^ PdfCertificateRequest
Remarks
This event is only meaningful for PDF documents and it is solely raised only if the PdfShowOpenFileDialogForDecryption property is set to false.

Be aware that without entering the correct certificate file the required PDF document will not display.

Example
How to add this event to your GdViewer control.
'We assume that the GdViewer1 control has been properly integrated.
Friend WithEvents GdViewer1 As GdPicture14.GdViewer
            
'Set this property to False to properly use this event.
GdViewer1.PdfShowOpenFileDialogForDecryption = False
            
'Add the event.
AddHandler GdViewer1.PdfCertificateRequest, AddressOf GdViewer1_PdfCertificateRequest
            
'Define the event.
Sub GdViewer1_PdfCertificateRequest(ByRef CertPath As String, ByRef Password As String) Handles GdViewer1.PdfCertificateRequest
    'Display your own dialog box to allow users to insert the correct digital ID file and the corresponded password.
End Sub
//We assume that the GdViewer1 control has been properly integrated.
            
//Set this property to false to properly use this event.
GdViewer1.PdfShowOpenFileDialogForDecryption = false
            
//Add the event.
GdViewer1.PdfCertificateRequest += GdViewer1_PdfCertificateRequest;
            
//Define the event.
void GdViewer1_PdfCertificateRequest(ref string CertPath,  ref string Password)
{
    //Display your own dialog box to allow users to insert the correct digital ID file and the corresponded password.
}
See Also