Strange...

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
dalstine
Posts: 6
Joined: Thu May 26 2005

Strange...

Post by dalstine »

I only seem to have a problem printing to the converter when I'm shelling out to another program. Anything I create directly from within my VB app seems to print fine. Any ideas?

My code successfully executes the other app, but I get an error saying the printer is not activated or that it couldn't start the print job.

This is converter version 2.50-b3. It's probably something really simple I overlooked but I need to make sure I'm able to do this before I purchase the Developer Edition.

Code: Select all

Private WithEvents PDF As CDIntfEx.CDIntfEx

Private Sub Class_Initialize()
...
    Set PDF = New CDIntfEx.CDIntfEx
    On Error Resume Next
    PDF.DriverInit "Job PDF Converter"
    PDF.EnablePrinter "Evaluation Version Developer", "deleted"
    PDF.CaptureEvents True
...
End Sub

Private Sub Class_Terminate()
...
    PDF.CaptureEvents False
    PDF.DriverEnd
    Set PDF = Nothing
...
End Sub

Private Function SummaryBody2(Info As tTriInfo, ByVal WarnLength As Double, ByVal JobID As Long) As Boolean
....
  For cTicket = 1 To tTicket
    ....
    PDF.SetDefaultPrinter
    PDF.FileNameOptionsEx = 1 + 2 + 20 ' NoPrompt + UseFileName
    PDF.CaptureEvents True
    PDF.DefaultFileName = DesktopDir & "\" & JobID & "-" & cTicket & "-A.pdf"   ' set output file name
    PDF.EnablePrinter "Evaluation Version Developer", "deleted for post"
    ErrorCode = ExecCmd("...") ' Win32 shell call.. waits for program to exit.
    Do Until DocProcess = False ' waits for PDF to be created
      DoEvents
    Loop
    PDF.RestoreDefaultPrinter
  Next cTicket
....
End Function
Post Reply