0

I'm trying to print a raster image using PCL in vb.net. I have the first few commands to start PCL:

Imports Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6

Module Module1

    Sub Main()
        Dim bytes As Integer = 57
        Dim f22 As New Printer
        f22.Print(Chr(27) & "*r0F" & Chr(27) & "*t150R" & Chr(27) & "*r450S" & Chr(27) & "*r2" & Chr(27) & "*b0M" & Chr(27) & "*r1U")
        f22.EndDoc()
    End Sub

End Module

However, when the page prints the output as:

*r0F*t150R*r450S*r2*b0M*r1U

In other words, the PCL isn't being properly read by either .net or the printer as pcl, and is just being processed as a normal string. Can anyone help me get this working?

Thanks

Undefined
  • 655
  • 1
  • 4
  • 13
  • What is this printer.Print you speak of? :) Seriously though, please show some more code... – Mr47 Jul 19 '13 at 14:26
  • Done. Sorry about that. – Undefined Jul 19 '13 at 14:30
  • 3
    You are using completely the wrong method. Sending PCL directly to the printer requires bypassing the printer driver. Check [this KB article](http://support.microsoft.com/kb/322090) for the required code. – Hans Passant Jul 19 '13 at 14:37
  • 3
    In addition, why are you using the VB6 compatibility pack? From the [documentation](http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.powerpacks.printing.compatibility.vb6.aspx): *"This namespace enables Visual Basic 6.0 Printer code to run without modification in an upgraded project; **it is not intended for new development. For new development, use the PrintDocument component.**"* – JDB Jul 19 '13 at 14:46
  • Guys, your comments deserve to be answers. :) – Victor Zakharov Jul 19 '13 at 20:31

0 Answers0