Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm writing a program at the moment. It's a Kitchen Video Screen.

The software I'm dealing with has the ability to either print via a windows printer driver, or directly via sending escpos commands.

Using the windows print driver, while much easier, isn't as flexible as I need to be able to cipher through the information to give different font properties to certain sections of the print job. (EG I need products to print in large, and I need the products attached to that to print small and in red colour)

So, I'm trying to understand how I can incorporate Escpos within my software
(Also saves me from loading print drivers which is better as it is using less resources)

Escpos is a printing language developed by Epson that allows you to set parameters to the string that's about to be printed, including size, colour.

Could someone give me a hint, this is the next big part of my project, and I'm not to sure where to start.

I'm guessing I need to write a class that has all of the escpos commands, and as a line is read from the incoming port, it would then be encoded as per the class I have created.
My head is saying that I need to write a whole bunch of If statements, but I'm sure there would be a much easier way to do it.
Posted
Updated 26-Oct-16 13:13pm
Comments
[no name] 5-May-14 20:31pm    
Start by reading the documentation, http://content.epson.de/fileadmin/content/files/RSD/downloads/escpos.pdf
Mendaharin 5-May-14 20:45pm    
I've got all of that information. I also have the proper escpos commands sheet. I am just not sure on how to receive the string, and then cross reference that string to an encoder. That's the bit I'm a little confused on.
Sergey Alexandrovich Kryukov 5-May-14 20:57pm    
Why? why?! It will give you non-portable Epson-oriented code. Universal printing is easy enough, why not using it?
—SA
Mendaharin 5-May-14 21:09pm    
Many POS systems use escpos, so I want to be able to use the program with multiple POS's
I can see within our software that we can tell the windows driver to print a section in red, but I am not sure how to write my software so when it receives the red command it then prints the string in red within my textbox.
Sergey Alexandrovich Kryukov 6-May-14 0:35am    
I am not convinced (many system use it, so why you should do? speed? anything else?), but I understand what you are doing.
—SA

Hi,
I also need to parse ESC-POS files and display them on screen.
Can you please post your code here so I can use it?
I would really appreciate it, thanks!
 
Share this answer
 
Comments
[no name] 26-Oct-16 19:48pm    
How is you begging for someone else's code a solution to this already answered question?
Mendaharin 26-Oct-16 20:00pm    
Abramson - I had alot of trouble with it, but the software I was working with allowed me to write my own ESC-POS language, I translated hex through to a readable string, and parsed on that - ie: I found the hex value for a string and then my program looked for that string and used boolean values based on if that string was found.

It worked for what I needed.

You're on your own with this one. There is plenty of documentation on epson's ESC-POS, but you would be required to write a library which I did not have the skills to do at the time of this question.
 
Share this answer
 
Comments
SoMad 6-May-14 0:51am    
As I understand it, he wants to "go the other way". I believe he wants to do this:
- Use a 3rd party software that prints out receipts.
- Receive the receipt data in his application.
- Parse the data and display it on a monitor.

Soren Madsen
Sergey Alexandrovich Kryukov 6-May-14 0:54am    
Excuse me, why do you thing OP wants that?

I don't understand why "the other way" and "3rd party". Why not Microsoft? I would not answer on anything without understanding of some reasonable motivation of the requirement.

—SA
SoMad 6-May-14 0:59am    
Because he writes "The software I'm dealing with has the ability to either print via a windows printer driver, or directly via sending escpos commands." and later "...and as a line is read from the incoming port, it would then be encoded as per the class I have created."

So, I think he wants to receive the data, just as a printer does, remove (or to some extent interpret) the Epson ESC/POS control codes from the data in order to present the data.

Soren Madsen
Sergey Alexandrovich Kryukov 6-May-14 1:19am    
That I could see, and that I referred to by saying "instead of using this Epson language directly". It could be some 3rd party library, but, first of all, I understood it as the code possible written by OP. I would see no point. Perhaps OP just was unaware of the MS library on the topic.
—SA
Mendaharin 6-May-14 1:48am    
Cheers Sergey and SoMad - I will look at this class. Your correct I had no idea about it :)
SoMad you are correct I want to receive the data exactly like the printer does :)
I've got a lot of reading to do :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900