Example





In This Topic
GdPicture14 Namespace / GdViewer Class / PdfShowOpenFileDialogForDecryption Property

PdfShowOpenFileDialogForDecryption Property (GdViewer)

In This Topic
Enables or disables the option that allows you to utilize your own dialog box requesting a certificate file if the PDF document to display is protected.

If this property is set to true, the GdViewer control prompts the user automatically with the dialog box to insert the file if the PDF to display is protected. Changing this property to false will force the control to use your own dialog box. Then you will have to catch the PdfCertificateRequest event to display your dialog box for entering the certificate file.

Syntax
'Declaration
 
Public Property PdfShowOpenFileDialogForDecryption As Boolean
public bool PdfShowOpenFileDialogForDecryption {get; set;}
public read-write property PdfShowOpenFileDialogForDecryption: Boolean; 
public function get,set PdfShowOpenFileDialogForDecryption : boolean
public: __property bool get_PdfShowOpenFileDialogForDecryption();
public: __property void set_PdfShowOpenFileDialogForDecryption( 
   bool value
);
public:
property bool PdfShowOpenFileDialogForDecryption {
   bool get();
   void set (    bool value);
}

Property Value

The default value is true.
Remarks
This property is only meaningful for PDF documents.

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

Example
How to utilize this property in 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 allow the viewer control to use the event.
GdViewer1.PdfShowOpenFileDialogForDecryption = False
            
'Add the event.
AddHandler GdViewer1.PdfCertificateRequest, AddressOf GdViewer1_PdfCertificateRequest
            
'Define the event.
Sub GdViewer1_PdfCertificateRequest(ByRef Password As String)
    'Display your own dialog box to allow users to insert the correct password.
End Sub
//We assume that the GdViewer1 control has been properly integrated.
            
//Set this property to false to allow the viewer control to use the event.
GdViewer1.PdfShowOpenFileDialogForDecryption = false
            
//Add the event.
GdViewer1.PdfCertificateRequest += GdViewer1_PdfCertificateRequest;
            
//Define the event.
void GdViewer1_PdfCertificateRequest(ref string Password)
{
    //Display your own dialog box to allow users to insert the correct password.
}
See Also