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





In This Topic
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.

Please check the corresponded GdViewer.PdfFileNavigationEventHandler for given parameters.

Syntax
'Declaration
 
Public Event PdfFileNavigation As GdViewer.PdfFileNavigationEventHandler
public event GdViewer.PdfFileNavigationEventHandler PdfFileNavigation
public event PdfFileNavigation: GdViewer.PdfFileNavigationEventHandler; 
In JScript, you can handle the events defined by another class, but you cannot define your own.
public: __event GdViewer.PdfFileNavigationEventHandler* PdfFileNavigation
public:
event GdViewer.PdfFileNavigationEventHandler^ PdfFileNavigation
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 add and use this event in your GdViewer control.
'We assume that the GdViewer1 control has been properly integrated.
Friend WithEvents GdViewer1 As GdPicture14.GdViewer
            
'Add the event.
AddHandler GdViewer1.PdfFileNavigation, AddressOf GdViewer1_PdfFileNavigation
            
'Enabling PDF file links handling.
PdfEnableFileLinks = True
            
'Define the event.
Sub GdViewer1_PdfFileNavigation(ByRef FilePath As String, ByRef Cancel As Boolean) Handles GdViewer1.PdfFileNavigation
    MessageBox.Show("The filename is: " + FilePath, "GdViewer.PdfFileNavigation")
    'Turning this parameter to True disables automatic handling of the file by the toolkit.
    Cancel = True
End Sub
//We assume that the GdViewer1 control has been properly integrated.
            
//Add the event.
GdViewer1.PdfFileNavigation += GdViewer1_PdfFileNavigation;
            
//Enabling PDF file links handling.
PdfEnableFileLinks = true;
            
//Define the event.
void GdViewer1_PdfFileNavigation(ref string FilePath, ref bool Cancel)
{
    MessageBox.Show("The filename is: " + FilePath, "GdViewer.PdfFileNavigation");
    //Turning this parameter to true disables automatic handling of the file by the toolkit.
    Cancel = true;
}
See Also