Hi,
Has anyone, or does anyone know how to print from VB to an EPSON printer (TM-88III) using ESC/POS?
The printer would be connected to my COM Port.
Any help or examples would be much appreciated.
Regards
Printable View
Hi,
Has anyone, or does anyone know how to print from VB to an EPSON printer (TM-88III) using ESC/POS?
The printer would be connected to my COM Port.
Any help or examples would be much appreciated.
Regards
why dont you want to use the
printer.print method?
Hi,
I've just tried that using the following and I'm able to print to it.
VB Code:
Private Sub Command1_Click() Dim P As Object For Each P In Printers If P.Port = "COM1:" Then Set Printer = P Exit For End If Next P Printer.Print "Hello" Printer.EndDoc End Sub
Below is an example I found in the EPSON ESC/POS FAQ...
VB Code:
PRINT #1, CHR$(&H1B);"@"; 'Initializes the printer (ESC @) PRINT #1, CHR$(&H1B);"a";CHR$(1);'Specifies a centered printing position (ESC a) PRINT #1, CHR$(&H1B);"!";CHR$(0); 'Specifies font A (ESC !) PRINT #1, "January 14, 2002 15:00"; PRINT #1, CHR$(&H1B);"d";CHR$(3); 'Prints and 3 line feeding (ESC d) PRINT #1, CHR$(&H1B);"a";CHR$(0); 'Selects the left print position (ESC a) PRINT #1, CHR$(&H1B);"!";CHR$(1); 'Selects font B PRINT #1, "TM-U210B $20.00";CHR$(&HA); PRINT #1, "TM-U210D $21.00";CHR$(&HA); PRINT #1, "PS-170 $17.00";CHR$(&HA); PRINT #1, CHR$(&HA); 'Line feeding (LF) PRINT #1, CHR$(&H1B);"!";CHR$(17); 'Selects double-height mode PRINT #1, "TOTAL $58.00"; CHR$(&HA); PRINT #1, CHR$(&H1B);"!";CHR$(0); 'Cancels double-height mode PRINT #1, "------------------------------";CHR$(&HA); PRINT #1, "PAID $60.00";CHR$(&HA); PRINT #1, "CHANGE $ 2.00";CHR$(&HA); PRINT #1, CHR$(&H1D);"V";CHR$(66);CHR$(0); 'Feeds paper & cut
I tried sending this to the printer by changing 'PRINT #1' to 'Printer.Print', it got there but took a long time, and not fully.
In the FAQ it just shows the above as an example, how do I get the above sent to the printer?
Also the printer object is fine, if the printer is installed. But what if the printer is just attached to COM1, but not installed in windows and the COM settings are being read in from an ini file?
Regards
Hi,
Resolved...
VB Code:
Open "COM1" For Output As #1 Print #1, Chr$(&H1B); "@"; 'Initializes the printer (ESC @) Print #1, Chr$(&H1B); "a"; Chr$(1); 'Specifies a centered printing position (ESC a) Print #1, Chr$(&H1B); "!"; Chr$(0); 'Specifies font A (ESC !) Print #1, "January 14, 2002 15:00"; Print #1, Chr$(&H1B); "d"; Chr$(3); 'Prints and 3 line feeding (ESC d) Print #1, Chr$(&H1B); "a"; Chr$(0); 'Selects the left print position (ESC a) Print #1, Chr$(&H1B); "!"; Chr$(1); 'Selects font B Print #1, "TM-U210B $20.00"; Chr$(&HA); Print #1, "TM-U210D $21.00"; Chr$(&HA); Print #1, "PS-170 $17.00"; Chr$(&HA); Print #1, Chr$(&HA); 'Line feeding (LF) Print #1, Chr$(&H1B); "!"; Chr$(17); 'Selects double-height mode Print #1, "TOTAL $58.00"; Chr$(&HA); Print #1, Chr$(&H1B); "!"; Chr$(0); 'Cancels double-height mode Print #1, "------------------------------"; Chr$(&HA); Print #1, "PAID $60.00"; Chr$(&HA); Print #1, "CHANGE $ 2.00"; Chr$(&HA); Print #1, Chr$(&H1D); "V"; Chr$(66); Chr$(0); 'Feeds paper & cut Close #1
Regards
Great.... it works.....
can anyone help me to explain, how to print in red with this pos printer.
i tried this
vb Code:
Print #1, Chr$(27) + Chr$(64) Print #1, Chr$(27) + Chr$(114) + Chr$(1) ' Change Ribbon Color Print #1, "Hello World" + Chr$(10)
but didn't worked. i want to know what is the wrong with my code?
ref: Refference
i believe it should be 5 for red