GdPicture.NET.14
GdPicture14.WPF 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 URI RFC 2396.

The event makes use of bubble routing strategy. Please check the corresponded GdViewer.PdfUriNavigationEventArgs for given parameters.

Syntax
'Declaration
 
Public Event PdfUriNavigation As GdViewer.PdfUriNavigationHandler
public event GdViewer.PdfUriNavigationHandler PdfUriNavigation
public event PdfUriNavigation: GdViewer.PdfUriNavigationHandler; 
In JScript, you can handle the events defined by another class, but you cannot define your own.
public: __event GdViewer.PdfUriNavigationHandler* PdfUriNavigation
public:
event GdViewer.PdfUriNavigationHandler^ PdfUriNavigation
Event Data

The event handler receives an argument of type GdViewer.PdfUriNavigationEventArgs containing data related to this event. The following GdViewer.PdfUriNavigationEventArgs properties provide information specific to this event.

PropertyDescription
Allows to cancel the subsequent URI navigation action when you turn this parameter to true in the raised event.  
(Inherited from System.Windows.RoutedEventArgs)
(Inherited from System.Windows.RoutedEventArgs)
(Inherited from System.Windows.RoutedEventArgs)
(Inherited from System.Windows.RoutedEventArgs)
A uniform resource identifier (URI) as a string.  
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 utilize this event in your GdViewer control.
'We assume that the GdViewer1 control has been properly integrated
'and the PdfUriNavigation event has been properly added.
            
'Enabling the URI navigation handling.
PdfEnableLinks = True
            
'Define the event.
Sub GdViewer1_PdfUriNavigation(ByVal sender As Object, ByVal e As GdPicture14.WPF.GdViewer.PdfUriNavigationEventArgs)
    MessageBox.Show("The URI is: " + e.URI, "GdViewer.PdfUriNavigation")
    'Turning this parameter to true disables automatic handling of the specified URI by the toolkit.
    e.Cancel = True
End Sub
//We assume that the GdViewer1 control has been properly integrated
//and the PdfUriNavigation event has been properly added.
            
//Enabling the URI navigation handling.
PdfEnableLinks = true;
            
//Define the event.
void GdViewer1_PdfUriNavigation(object sender, GdPicture14.WPF.GdViewer.PdfUriNavigationEventArgs e)
{
    MessageBox.Show("The URI is: " + e.URI, "GdViewer.PdfUriNavigation");
    //Turning this parameter to true disables automatic handling of the specified URI by the toolkit.
    e.Cancel = true;
}
See Also