Example





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

PdfLaunchAction Event (GdViewer)

In This Topic
This event is raised when a Launch action contained in the displayed PDF document has been triggered to launch an application, usually to open or print a file.

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

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

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

PropertyDescription
A member of the PdfActionLaunchOperation enumeration. The type of the launch action to be executed.  
Allows to cancel the subsequent application launching action when you turn this parameter to true in the raised event.  
The path of the application to be launched or the file to be opened or printed according to the specified ActionType parameter.  
(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. At the same, this event only handles the Launch 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 PdfLaunchAction event has been properly added.
            
'Define the event.
Sub GdViewer1_PdfLaunchAction(ByVal sender As Object, ByVal e As GdPicture14.WPF.GdViewer.PdfLaunchActionEventArgs)
    MessageBox.Show("The operation is: " + e.ActionType.ToString() + "\nThe filename is: " + e.FilePath, "GdViewer.PdfLaunchAction")
    '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 PdfLaunchAction event has been properly added.
            
//Define the event.
void GdViewer1_PdfLaunchAction(object sender, GdPicture14.WPF.GdViewer.PdfLaunchActionEventArgs e)
{
    MessageBox.Show("The operation is: " + e.ActionType.ToString() + "\nThe filename is: " + e.FilePath, "GdViewer.PdfLaunchAction");
    //Turning this parameter to true disables automatic handling of the file by the toolkit.
    e.Cancel = true;
}
See Also