Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb_dotnet thread: How do I use Printer Escape Sequences in VB.Net?


Message #1 by "Hal Gibson" <halg@d...> on Thu, 10 Jan 2002 19:51:42
How do I use HP Printer Escape Sequences (aka Printer Passthrough
Codes) in VB.Net?

Our current code relies heavily on passthroughs (which are sent to the
Printer.hdc object) in our custom report printing because of speed
considerations due to their graphical nature.

example:

Public Declare Function EscapeCodes Lib "gdi32" Alias "Escape" (ByVal hdc&,
ByVal nEscape&, ByVal nCount&, ByVal InData$, ByVal lpOutData&) As Long

Public Sub UsePrinterPart(DataToPrint As String)

Const cPASSTHROUGH As Long = 19
Dim pcl_Escape_Tmp As String

pcl_Escape_Tmp = Chr$(Len(DataToPrint) Mod 256) &Chr$(Len(DataToPrint) \
256) & DataToPrint

Printer.CurrentY = ciZero ' no printer object in VB.Net
Printer.Print vbNullString
EscapeCodes Printer.hdc, cPASSTHROUGH, 0, pcl_Escape_Tmp, ByVal 0&

End Sub

How would I do this in VB.Net?

I would appreciate any help you can give me

  Return to Index