GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / PdfEnableLinks Property
Example





In This Topic
PdfEnableLinks Property (GdViewer)
In This Topic
Specifies whether the GdViewer control will follow a hyperlink contained in the displayed PDF document when a user clicks that hyperlink.

Setting this property to true allows users to open web links contained in the loaded PDF documents. Turning this property to false will disable this behaviour.

The PdfUriNavigation event is raised before navigating to the specified hyperlink.

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

Property Value

The default value is true.
Remarks
This property is only meaningful for PDF documents. At the same, this property only relates to web links in PDF documents.

Just to remind you, that you can benefit from using the PdfUriNavigation event to handle the specified hyperlink by your own.

Example
How to utilize this property in your GdViewer control.
'We assume that the GdViewer1 control has been properly integrated
'and the PdfUriNavigation event has been properly added.
            
'Enabling hyperlink navigation handling.
PdfEnableLinks = True
            
'Define the event.
Sub GdViewer1_PdfUriNavigation(ByRef URI As String, ByRef Cancel As Boolean) Handles GdViewer1.PdfUriNavigation
    MessageBox.Show("The hyperlink is: " + URI, "GdViewer.PdfEnableLinks")
    'Turning this parameter to True disables automatic handling of the specified hyperlink by the toolkit.
    Cancel = True
    'You can handle the hyperlink by your own here.
End Sub
//We assume that the GdViewer1 control has been properly integrated
//and the PdfUriNavigation event has been properly added.
            
//Add the event.
GdViewer1.PdfUriNavigation += GdViewer1_PdfUriNavigation;
            
//Enabling hyperlink navigation handling.
PdfEnableLinks = true;
            
//Define the event.
void GdViewer1_PdfUriNavigation(ref string URI, ref bool Cancel)
{
     MessageBox.Show("The hyperlink is: " + URI, "GdViewer.PdfEnableLinks");
    //Turning this parameter to true disables automatic handling of the specified hyperlink by the toolkit.
    Cancel = true;
    //You can handle the hyperlink by your own here.
}
See Also