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
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;
}
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