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





In This Topic
PdfUriNavigation Event (GdViewer)
In This Topic
This event is raised when a URI action contained in the displayed PDF document has been triggered to resolve a uniform resource identifier. The event only occurs if the PdfEnableLinks property is set to true.

A URI is a string that identifies a resource on the Internet - typically a file that is the destination of a hypertext link, although it can also resolve to a query or other entity. URIs are described in RFC 2396 - Uniform Resource Identifier (URI).

Please check the corresponded GdViewer.PdfUriNavigationEventHandler for given parameters.

Syntax
'Declaration
 
Public Event PdfUriNavigation As GdViewer.PdfUriNavigationEventHandler
public event GdViewer.PdfUriNavigationEventHandler PdfUriNavigation
public event PdfUriNavigation: GdViewer.PdfUriNavigationEventHandler; 
In JScript, you can handle the events defined by another class, but you cannot define your own.
public: __event GdViewer.PdfUriNavigationEventHandler* PdfUriNavigation
public:
event GdViewer.PdfUriNavigationEventHandler^ PdfUriNavigation
Remarks
This event is only meaningful for PDF documents and it is solely raised only if the PdfEnableLinks property is set to true. At the same, this event only handles the URI action defined in the PDF documents.
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
            
'Add the event.
AddHandler GdViewer1.PdfUriNavigation, AddressOf GdViewer1_PdfUriNavigation
            
'Enabling URI navigation handling.
PdfEnableLinks = True
            
'Define the event.
Sub GdViewer1_PdfUriNavigation(ByRef URI As String, ByRef Cancel As Boolean) Handles GdViewer1.PdfUriNavigation
    MessageBox.Show("The URI is: " + URI, "GdViewer.PdfUriNavigation")
    'Turning this parameter to True disables automatic handling of the specified URI by the toolkit.
    Cancel = True
End Sub
//We assume that the GdViewer1 control has been properly integrated.
            
//Add the event.
GdViewer1.PdfUriNavigation += GdViewer1_PdfUriNavigation;
            
//Enabling URI navigation handling.
PdfEnableLinks = true;
            
//Define the event.
void GdViewer1_PdfUriNavigation(ref string URI, ref bool Cancel)
{
     MessageBox.Show("The URI is: " + URI, "GdViewer.PdfUriNavigation");
    //Turning this parameter to true disables automatic handling of the specified URI by the toolkit.
    Cancel = true;
}
See Also