Escape codes WordPad

H

Hugo

Hello,
I am building a software application for a cash register. The output
from my cash register will go to a WordPad® document and I want to
print the receipt with a receipt printer. I want to be able to use any
receipt printer, so it doesn't care what kind of receipt printer I'm
gonna buy.
I found out that there are printers with a special "control font", so
when you select the "control font" and you type for example an 'A'
that a cash drawer opens.
On the other hand, you have POS printers. I know how to handle them
with Delphi. I can use the OPOS component.
And there are printers that use so called "escape codes" and I have no
idea how to handle with them.

Conclusion: I want to print a receipt with WordPad®, using "escape
codes". Can I use "Escape codes" directly in WordPad®? Or do I need to
write an external program to use the "escape codes"? And if I need an
external program, does anyone have one?

Hope someone knows????

Greetings Hugovic
 
T

Tom

Hugo said:
Hello,
I am building a software application for a cash register. The output
from my cash register will go to a WordPad® document and I want to
print the receipt with a receipt printer. I want to be able to use any
receipt printer, so it doesn't care what kind of receipt printer I'm
gonna buy.
I found out that there are printers with a special "control font", so
when you select the "control font" and you type for example an 'A'
that a cash drawer opens.
On the other hand, you have POS printers. I know how to handle them
with Delphi. I can use the OPOS component.
And there are printers that use so called "escape codes" and I have no
idea how to handle with them.

Conclusion: I want to print a receipt with WordPad®, using "escape
codes". Can I use "Escape codes" directly in WordPad®? Or do I need to
write an external program to use the "escape codes"? And if I need an
external program, does anyone have one?

Hope someone knows????

Greetings Hugovic

Um, no. The "ESC codes" must be fed directly to the printer. Usually in a
serial stream along with the print data.

Software built in to the printer decodes this and passes the instruction set
to the printer itself, i.e, "Start Bold', 'Line Feed', 'Carriage return',
etc.

By the way, these codes will not work with "Windows only" printers but was
very common (actually necessary) with DOS printers.

First, determine which printer you are going to use. Then contact that
company and ask for the SDK for that printer (they are free). Then just
stream that data to the Windows printer driver for the machine in question.
Bob's your uncle.

STAR makes some nice POS/receipt printers. Easy to program too.

Tom
 
J

Jim

"Escape codes" are text sequences which start with the escape character.
You use these sequences to send commands to the printer.
Jim
 
L

Lucas Tam

(e-mail address removed) (Hugo) wrote in
And there are printers that use so called "escape codes" and I have no
idea how to handle with them.

You pipe these text codes directly to your printer port.
Conclusion: I want to print a receipt with WordPad©, using "escape
codes". Can I use "Escape codes" directly in WordPad©?

No, Windows' Printer Driver will override your escape codes.
Or do I need to
write an external program to use the "escape codes"? And if I need an
external program, does anyone have one?

To use escape codes, you'll need to send the codes as raw text to the
printer.
 
H

Hugo

Hmmmm.. Too bad, if i'm right, I have to write a program that sends
raw strings to the printer and the text/data that is in WordPad® is
input for my program...
Okay, thank you very much for your reactions, you have been a great
help.

Greetings Hugovic
 
L

Lucas Tam

(e-mail address removed) (Hugo) wrote in @posting.google.com:
Hmmmm.. Too bad, if i'm right, I have to write a program that sends
raw strings to the printer and the text/data that is in WordPad© is
input for my program...

Out of curiousity, why are you storing data in a WordPad (RTF) file? Why
not in a database?
 
B

Bennett Price

Hugo said:
Hello,
I am building a software application for a cash register. The output
from my cash register will go to a WordPad® document and I want to
print the receipt with a receipt printer. I want to be able to use any
receipt printer, so it doesn't care what kind of receipt printer I'm
gonna buy.
I found out that there are printers with a special "control font", so
when you select the "control font" and you type for example an 'A'
that a cash drawer opens.
On the other hand, you have POS printers. I know how to handle them
with Delphi. I can use the OPOS component.
And there are printers that use so called "escape codes" and I have no
idea how to handle with them.

Conclusion: I want to print a receipt with WordPad®, using "escape
codes". Can I use "Escape codes" directly in WordPad®? Or do I need to
write an external program to use the "escape codes"? And if I need an
external program, does anyone have one?

Hope someone knows????

Greetings Hugovic
I believe you can accomplish this by using the edit.com editor (the old
DOS editor that is included with various versions of Windows.)
Control+P and then the escape key. Unfortunately you can't then cut and
paste the escape code into Notepad.
 
H

Hugo

Out of curiousity, why are you storing data in a WordPad (RTF) file? Why
not in a database?

It was not my idea, but my boss wanted that. I can understand why he
wants that. He want's to put the application on the market and the
customers have to be able to easily change the layout of the receipt.
He already uses wordpad for other purposes, so he doesn't want to
change it.

Greetings Hugovic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top