Imports PrinterClassDll


Public Class Form1

    Private Sub btn_Print_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_Print.Click
        'Dim result As Boolean
        Dim w32prn As New Win32PrintClass

        w32prn.SetPrinterName("Metapace T-3II")

        ' Open CashDrawer
        'w32prn.OpenCashdrawer(2)   ' 2 pin cashdrawer
        w32prn.OpenCashdrawer(5)    ' 5 pin cashdrawer			

        ' Print Image
        w32prn.SetDeviceFont(9.5F, "FontControl", False, False)
        w32prn.PrintText("x")       ' Aligns text to the center
        'w32prn.PrintText("G")       ' 1st NV Image
        'w32prn.PrintText("H")       ' 2nd NV Image

        ' Print Receipt
        w32prn.SetDeviceFont(9.5F, "FontA2x1", False, True)
        w32prn.PrintText("Metapace's MALL")
        w32prn.SetDeviceFont(9.5F, "FontA1x1", False, False)
        w32prn.PrintText("Buy Online or call")
        w32prn.PrintText("")
        w32prn.SetDeviceFont(7.0F, "FontB2x1", False, True)
        w32prn.PrintText("1-800-915-3355")

        w32prn.SetDeviceFont(9.5F, "FontControl", False, False)
        w32prn.PrintText("w")   'Aligns text to the left

        w32prn.SetDeviceFont(9.5F, "FontA1x1", False, False)
        w32prn.PrintText("------------------------------------------")
        w32prn.PrintText("Metapace T-3II Printer               $999")
        w32prn.PrintText("------------------------------------------")
        w32prn.SetDeviceFont(9.5F, "FontA1x1", False, True)
        w32prn.PrintText("Total purchase :                     $999")
        w32prn.SetDeviceFont(9.5F, "FontA1x1", False, False)
        w32prn.PrintText("------------------------------------------")

        w32prn.SetDeviceFont(9.5F, "FontControl", False, False)
        w32prn.PrintText("x")   ' Aligns text to the center
        w32prn.PrintText("r")   ' Adds HRI characters in FontA below the barcode 

        'w32prn.SetDeviceFont(20.0F, "Code128", False, False)
        'w32prn.PrintText("{A{S12235884584645")

        w32prn.SetDeviceFont(20.0F, "Barcode9", False, False)
        'w32prn.SetDeviceFont(20.0F, "Barcode2", False, False)
        'w32prn.SetDeviceFont(20.0F, "Barcode3", False, False)
        'w32prn.SetDeviceFont(20.0F, "Barcode4", False, False)
        'w32prn.SetDeviceFont(20.0F, "Barcode5", False, False)
        'w32prn.SetDeviceFont(20.0F, "Barcode6", False, False)
        'w32prn.SetDeviceFont(20.0F, "Barcode7", False, False)
        'w32prn.SetDeviceFont(20.0F, "Barcode8", False, False)

        'w32prn.SetDeviceFont(20.0F, "2D-Code1", False, False)
        'w32prn.SetDeviceFont(20.0F, "2D-Code2", False, False)
        'w32prn.SetDeviceFont(20.0F, "2D-Code3", False, False)
        'w32prn.SetDeviceFont(20.0F, "2D-Code4", False, False)
        'w32prn.SetDeviceFont(20.0F, "2D-Code5", False, False)
        'w32prn.SetDeviceFont(20.0F, "2D-Code6", False, False)
        'w32prn.SetDeviceFont(20.0F, "2D-Code7", False, False)
        'w32prn.SetDeviceFont(20.0F, "2D-Code8", False, False)


        w32prn.PrintText("{A1234567890")

        w32prn.SetDeviceFont(9.5F, "FontA1x1", False, False)
        w32prn.PrintText("Date : 04/08/2003     Time : 09:32")
        w32prn.PrintText("No : 00018857302")
        w32prn.PrintText("")
        w32prn.PrintText("")
        w32prn.PrintText("FREE 2nd Bay Interface ")
        w32prn.PrintText("With Purchase of ANY Dimension Desktop")
        w32prn.PrintText("Ends Today !")

        ' Print Image
        w32prn.PrintImage("sample2.bmp")

        ' Cut Receipt
        'w32prn.SetDeviceFont(9.5F, "FontControl", False, False)
        'w32prn.PrintText("P")   ' Cut Receipt (partial cut)

        ' Print
        w32prn.EndDoc()
    End Sub


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class
