Example





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

Please check the corresponded GdViewer.PdfLaunchActionEventHandler for given parameters.

Syntax
'Declaration
 
Public Event PdfLaunchAction As GdViewer.PdfLaunchActionEventHandler
public event GdViewer.PdfLaunchActionEventHandler PdfLaunchAction
public event PdfLaunchAction: GdViewer.PdfLaunchActionEventHandler; 
In JScript, you can handle the events defined by another class, but you cannot define your own.
public: __event GdViewer.PdfLaunchActionEventHandler* PdfLaunchAction
public:
event GdViewer.PdfLaunchActionEventHandler^ PdfLaunchAction
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 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.PdfLaunchAction, AddressOf GdViewer1_PdfLaunchAction
            
'Define the event.
Sub GdViewer1_PdfLaunchAction(ByVal ActionType As PdfActionLaunchOperation, ByRef FilePath As String, ByRef Cancel As Boolean) Handles GdViewer1.PdfLaunchAction
    MessageBox.Show("The operation is: " + ActionType.ToString() + "\nThe filename is: " + FilePath, "GdViewer.PdfLaunchAction")
    'Turning this parameter to True disables automatic handling of the file by the toolkit.
    Cancel = True
    'Now you can handle the action.
    System.Diagnostics.Process.Start(FilePath)
End Sub
//We assume that the GdViewer1 control has been properly integrated.
            
//Add the event.
GdViewer1.PdfLaunchAction += GdViewer1_PdfLaunchAction;
            
//Define the event.
void GdViewer1_PdfLaunchAction(PdfActionLaunchOperation ActionType, ref string FilePath, ref bool Cancel)
{
    MessageBox.Show("The operation is: " + ActionType.ToString() + "\nThe filename is: " + FilePath, "GdViewer.PdfLaunchAction");
    //Turning this parameter to true disables automatic handling of the file by the toolkit.
    Cancel = true;
    //Now you can handle the action.
    System.Diagnostics.Process.Start(FilePath);
}
See Also