hello,i am using vb.net framework 4 and i have to print through a POS Printer.please help me.
how will i do that.thanks in advance
my code is given below.but its not working and giving error in
e.Graphics.DrawString(" NOTA DE PLATA", printFont10B, Brushes.Black, 10, 10)
.....error says Object reference not set to an instance of an object.
Private Sub PrintDocument1_PrintPage(sender As System.Object, e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim i As Integer
Dim printFont10B = New Font("Lucida Console", 10, FontStyle.Bold)
Dim printFont9R = New Font("Arial", 9, FontStyle.Regular)
Dim printFont8R = New Font("Arial", 8, FontStyle.Regular)
e.Graphics.DrawString(" NOTA DE PLATA", printFont10B, Brushes.Black, 10, 10)
e.Graphics.DrawString("-----------------------------------------", New Font(Me.Font.FontFamily, 8, FontStyle.Regular), Brushes.Black, 10, 70)
e.Graphics.DrawString("Numar nota: ", printFont9R, Brushes.Black, 10, 80)
e.Graphics.DrawString("|Denumire | Cant |Pret |", printFont9R, Brushes.Black, 10, 100)
End Sub
please help me