launch my application after pdf generated

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
mikeaerni
Posts: 1
Joined: Mon Jan 08 2007

launch my application after pdf generated

Post by mikeaerni »

is it possible to launch my application after the pdf is generated? i saw one post about catching the EnabledPre event, but doesn't that require my app to be running when the print job is started.
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hello,


The PDF Converter has the ability to execute an exe after it has terminated the printing process. In your situation you can programmatically bring your application. I have included below a vb 6.0 code snippet which illustrates this process.


Const NOPROMPT = &H1& ' do not prompt for file name
Const USEFILENAME = &H2& ' use file name set by SetDefaultFileName
‘else use document name

Const PostProcessing = &H10000 ' post process file using specified
‘ application

Private Sub Command3_Click()
On Error GoTo printer_error
Dim PrinterName As String

PrinterName = "Amyuni Dev Converter"
Set PDF = New CDIntfEx.CDIntfEx

PDF.DriverInit PrinterName

PDF.DefaultDirectory = "c:\temp"
PDF.DefaultFileName = "c:\temp\sample.pdf"

PDF.SetDefaultPrinter

'////////////////////////////////////////////////////////////////////////
PDF.PrinterParamStr("PostProcessing") = "C:\your_app.exe"

PDF.FileNameOptionsEx = NOPROMPT + USEFILENAME + PostProcessing

'Need to call this function right before every print out
PDF.EnablePrinter strLicensTo, strActivationCodeDemo

Printer.CurrentX = 100
Printer.CurrentY = 100
Printer.Print "hello world"
Printer.EndDoc

PDF.FileNameOptions = 0

'This is used to restore the default printer
PDF.RestoreDefaultPrinter
PDF.DriverEnd

Exit Sub
printer_error:
MsgBox Err.Description
End Sub

Hope this helps?
Post Reply