PdfLaunchAction Event (GdViewer)
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.
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);
}