Asked by:
AUTOMATIC TICKET DELIVER

Question
-
Good evening
I write a vb code that allows to make an automatic printing on a printer "epson" without a dialog box or button "print".
now what I want the printer to do is this:
When printing a ticket, it waits for the user to remove the ticket before it prints another one. the first ticket not removed blocks the arrival of the second ticket.
here is my code:
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.Activate()
End Sub
Private Sub Form1_Activated(ByVal sender As Object,
ByVal e As System.EventArgs) Handles MyBase.Activated
PrintDocument1.PrinterSettings.PrinterName ="epson"
If PrintDocument1.PrinterSettings.IsValid Then
PrintDocument1.Print()
Else
MessageBox.Show("invalid.")
'End If
End If
End Sub
Private Sub PrintDocument1_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
e.Graphics.DrawString(vbNewLine + vbNewLine + "NUMERO" + " " + ComboBox1.Text + " ", New Font("Elephant", 20, FontStyle.Bold), Brushes.Black, 10, 15)
End SubTuesday, April 24, 2018 8:54 PM
All replies
-
You will need to find the escape codes for the specific printer e.g. this page.
Farther reading
https://epson.com/For-Work/Robots/Integrated-Options/Epson-NET-Support-%28VB-Guide-%26-RC%2B-7-0-API%29/p/RNETSUPPORT
https://stackoverflow.com/questions/21010363/pos-printing-with-an-epson-printer-in-vb-net
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
VB Forums - moderator
Tuesday, April 24, 2018 10:30 PM -
i'm not satisfiedWednesday, April 25, 2018 9:38 PM
-
i don't know how can i put epson codes in my vb codeWednesday, April 25, 2018 9:39 PM
-
i don't know how can i put epson codes in my vb code
You can send control commands directly to a printer using the code described here:
https://www.codeproject.com/Tips/704989/Print-Direct-To-Windows-Printer-EPOS-ReceiptWednesday, April 25, 2018 9:49 PM