GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / PdfEnableFileLinks Property
Example





In This Topic
PdfEnableFileLinks Property (GdViewer)
In This Topic
Specifies whether the GdViewer control will automatically navigate to the linked file when a user clicks the associated file link in the displayed PDF document.

PDF documents are often designed to contain links to other files. Such an option is provided through a GoToR action handled by particular objects such as bookmarks or file links. Setting this property to true allows users to navigate to the linked file. Turning this property to false will disable this behaviour.

The PdfFileNavigation event is raised before displaying the linked file.

Syntax
'Declaration
 
Public Property PdfEnableFileLinks As Boolean
public bool PdfEnableFileLinks {get; set;}
public read-write property PdfEnableFileLinks: Boolean; 
public function get,set PdfEnableFileLinks : boolean
public: __property bool get_PdfEnableFileLinks();
public: __property void set_PdfEnableFileLinks( 
   bool value
);
public:
property bool PdfEnableFileLinks {
   bool get();
   void set (    bool value);
}

Property Value

The default value is true.
Remarks
This property is only meaningful for PDF documents. At the same, this property only relates to file links defined by the GoToR action in PDF documents.

Just to remind you, that you can benefit from using the PdfFileNavigation event to handle linked files by your own.

Example
How to utilize this property 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(ByRef FilePath As String, ByRef Cancel As Boolean) Handles GdViewer1.PdfFileNavigation
    MessageBox.Show("The filename is: " + FilePath, "GdViewer.PdfEnableFileLinks")
    'Turning this parameter to True disables automatic handling of the file by the toolkit.
    Cancel = True
    'You can handle the file by your own here.
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(ref string FilePath, ref bool Cancel)
{
    MessageBox.Show("The filename is: " + FilePath, "GdViewer.PdfEnableFileLinks");
    //Turning this parameter to true disables automatic handling of the file by the toolkit.
    Cancel = true;
    //You can handle the file by your own here.
}
See Also