Example





In This Topic
GdPicture14.WPF Namespace / GdViewer Class / PdfFileNavigation Event

PdfFileNavigation Event (GdViewer)

In This Topic
This event is raised when a GoToR action contained in the displayed PDF document has been triggered to open a linked file. The event only occurs if the PdfEnableFileLinks property is set to true.

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

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

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

PropertyDescription
Allows to cancel the subsequent file navigation action when you turn this parameter to true in the raised event.  
The path of the file to navigate to.  
(Inherited from System.Windows.RoutedEventArgs)
(Inherited from System.Windows.RoutedEventArgs)
(Inherited from System.Windows.RoutedEventArgs)
(Inherited from System.Windows.RoutedEventArgs)
Remarks
This event is only meaningful for PDF documents and it is solely raised only if the PdfEnableFileLinks property is set to true. At the same, this event only handles the file links defined by the GoToR action in PDF documents.
Example
How to utilize this event in your GdViewer control.
'We assume that the GdViewer1 control has been properly integrated
'and the PdfFileNavigation event has been properly added.
            
'Enabling PDF file links handling.
PdfEnableFileLinks = True
            
'Define the event.
Sub GdViewer1_PdfFileNavigation(ByVal sender As Object, ByVal e As GdPicture14.WPF.GdViewer.PdfFileNavigationEventArgs)
    MessageBox.Show("The filename is: " + e.FilePath, "GdViewer.PdfFileNavigation")
    'Turning this parameter to True disables automatic handling of the file by the toolkit.
    e.Cancel = True
End Sub
//We assume that the GdViewer1 control has been properly integrated
//and the PdfFileNavigation event has been properly added.
            
//Enabling PDF file links handling.
PdfEnableFileLinks = true;
            
//Define the event.
void GdViewer1_PdfFileNavigation(object sender, GdPicture14.WPF.GdViewer.PdfFileNavigationEventArgs e)
{
    MessageBox.Show("The filename is: " + e.FilePath, "GdViewer.PdfFileNavigation");
    //Turning this parameter to true disables automatic handling of the file by the toolkit.
    e.Cancel = true;
}
See Also