Print2eDoc SDK
SDK for document conversion to PDF, PNG, JPEG, TIFF...
Compatibility
VB VB.NET VC++ C# Delphi

Integrating Print2eDoc File Conversion Jobs With Workflows

Learn how to specify workflow applications that need to be launched when a file conversion job starts, when a page is printed, and when a job ends.
By Shivaranjini M.
Important

This product has been discontinued. Please check our old products page for more information.

In Version 1.03 of Gnostice Print2eDoc application and SDK, we introduced a feature that would allow you to launch other applications at different stages of a file conversion job - when the job starts, when a page is printed, and when the job ends.

This allows you to extend workflows or integrate Print2eDoc file conversion job with other processes. For example, you could run a batch file, send a notification to another process, or update a log maintained by another application.

The application launch settings are specified via new properties in the document creation profile object or IgtProfileSettingsX.

The following new boolean properties need to set to true to launch a specified application:

The launch of applications by these properties can be switched on and off collectively by setting the value of another new boolean property LaunchApplication.

To launch applications, the application filename and its parameters need to be specified via certain other new properties. For the application that is launched when a conversion job begins, the parameters would be:

Similar parameters are available for application launch settings that are executed when a page is printed and when a job ends.

The pre-defined parameters that you can send to the application are:

The following code snippet shows how to specify all three application launch settings.

Visual Basic C#
Dim PrinterObj As gtPrint2eDoc
Dim Params As Integer

Params = 0

'Create a Print2eDoc printer object
Set PrinterObj = New gtPrint2eDoc

'Create a new profile "LaunchApp" 
PrinterObj.SaveCurrentProfileAs("LaunchApp")

'Modify "LaunchApp"
PrinterObj.SelectCurrentProfile("LaunchApp")
With PrinterObj.CurrentProfile
 .LaunchApplication = True

 'Application launch when a job begins
 .LaunchAppOnStartJob = True
 .LaunchAppOnStartJobFileName = "C:\MyApp1.exe"
 Params = Params Or _
             TxgtLaunchApplicationParams.lpFileName
 Params = Params Or _
             TxgtLaunchApplicationParams.lpDocumentFormat
 .LaunchAppOnStartJobPredefinedParams = Params
 .LaunchAppOnStartJobCustomParams = "Custom Params"
 .LaunchAppOnStartJobRun = lwNormal

 'Application launch when rendering individual pages
 .LaunchAppOnRenderPage = True
 .LaunchAppOnRenderPageFileName = "C:\MyApp2.exe"
 Params = Params Or TxgtLaunchApplicationParams.lpFileName
 Params = Params Or TxgtLaunchApplicationParams.lpPageNumber
 .LaunchAppOnRenderPagePredefinedParams = Params
 .LaunchAppOnRenderPageCustomParams = "Custom Params"
 .LaunchAppOnRenderPageRun = lwNormal

 'Application launch when a job ends
 .LaunchAppOnEndJob = True
 .LaunchAppOnEndJobFileName = "C:\MyApp3.exe"
 Params = Params Or TxgtLaunchApplicationParams.lpFileName
 Params = Params Or TxgtLaunchApplicationParams.lpPageCount
 .LaunchAppOnEndJobPredefinedParams = Params
 .LaunchAppOnEndJobCustomParams = "Custom Params"
 .LaunchAppOnEndJobRun = lwNormal
End With

'Use the modified "LaunchApp" profile
'to convert a document and launch applications
PrinterObj.SelectCurrentProfile("LaunchApp")
PrinterObj.OutputDocumentName = "OutputPDF"
PrinterObj.OutputDocumentFormat = TxgtDocumentFormat.PDF
PrinterObj.ApplyChangesToCurrentProfile
PrinterObj.PrintDocument("input.doc")

The command-line equivalent of the application launch, as specified above for the beginning of the conversion job would be:

C:\MyApp1.exe OutputPDF.pdf PDF custom params

If the application you wish to launch requires a different syntax, then you can specify a custom batch file for the application launch setting. The batch file would then have to parse the parameters and then launch your application using the correct syntax.

Privacy | Legal | Feedback | Newsletter © 2002-2010 Gnostice Information Technologies Private Limited. All rights reserved.

This site is best viewed on a screen with minimum resolution of 1152 x 864 pixels. Windows users are advised to use Microsoft ClearType Tuning for optimal experience. Linux and other users can enable font smoothing, as supported by their OS. Also, please use the latest version of a standards-compliant browser such as Opera, FireFox, Chrome or Safari.