COURSE of the MONTH

Send Cut Command to POS printer.

I have a Star Micronics SP300 (POS) printer. It is installed as a
windows printer with Generic Text Only drivers. I'm using RawPrinter
Helper Class to
send data to the printer. See: http://support.microsoft.com/?id=322090
. It works correctly printing the text.

My only problem is that this printer has an AutoCuter feature (to cut
the ticket paper) but to make it work, I have to send a special code
to the printer.

I tried using the SendStringToPrinter method from the
rawprinteerhelper class (VB.NET), but it did not work.

I need to make this printer cut the paper under VB.NET (with
the printer installed under windows).

One problem is that this printer is serial (COM1) so, I cannot just
open the port and send the data because when it is installed as a
printer, the com1 is under exclusive access by windows. And also the
OPOS driver that has a function to send the cut command does not work
if the printer is installed in windows.

I think that a solution would be to use SendBytesToPrinter from
Rawprinterhelper class, but I just dont know how this function works.

Who is Participating?

The Chr(27) _is_ the Escape code; if you check an ASCII table, you'll find that CHR(27) is called ESCAPE. Most printers use ESC sequences for device control.

Since printing the string "the quick brown fox..." using SendStringToPrinter worked, we can assume that you CAN send escape sequences to the printer using SendStringToPrinter. So, this is the right way to go.

' FEED TO CUT POSITION THEN PERFORM PARTIAL CUT ( ONLY WORKS WITH PRINTERS THAT HAVE AUTO
' CUTTING CAPABILITY)
' IF PRINTER DOES NOT HAVE FULL CUT CAPABILITY, PARTIAL CUT WILL BE PERFORMED
' CMD: <ESC> "d" "3"
' PRINT #1, CHR$(27); CHR$(100); CHR$(51);

Well, escape code can and do vary from manufacturer to manufacturer and from model to model. So, ESC & "d3" may work for model 299, but not 300...

0

xuanruCommented: 2005-08-09

I understand this is an old question, but i am facing the same problem now! The only difference is my POS printer is Wincor Nixdorf ND69. I am using Windows NT Generic/Text Only Driver, and i have to use JAVA but not VB to code the ESC Sequence. The ESC sequece to CUT Receipt is <1B>H <69>H . Can anybody tell me how can i make it works???