Click here to Skip to main content
15,903,385 members
Please Sign up or sign in to vote.
3.40/5 (5 votes)
See more:
Hello to everyone,

I've been searching the net over a week, and I still can figure out how receipt printer works especially how to send commands.

I need to print a receipt to this "PRP-085IIIT" printer. The printer is connected via USB and using a Generic\Text Only driver. Windows 7.

I found this link http://support.microsoft.com/kb/322091 to send raw data to the printer. I manage to print but I can't cut the page at the end. From what I found, I need to sent command to the printer in order to cut the page. Thats my main problem, I can't figure out how to send command to the printer.

Also I'm using C# to develop my application.

Any kind of help would be appreciated because I'm out of resources.

Thanks a lot for your help.
Posted

1 solution

Use the same link you found. If your printer supports command language then find it out from their documentations. Send the command in the same way i.e. raw data.

If it is EPSON printers then you can send ESC/POS command using the article you found. Here is the ESC/ POS reference

http://nicholas.piasecki.name/blog/wp-content/uploads/2009/12/ESC-POS-Command-Guide.pdf[^]

Same way you can open cash drawer as well.
 
Share this answer
 
Comments
samudebr 17-Mar-11 7:03am    
Hi AlbinAbel, thanks for your response,

So in the link you gave me I found these code to cut the paper.

GS V m
Name Cut paper
Code ASCII GS V m
Hex. 1D 56 m
Decimal 29 86 m

Ref: http://nicholas.piasecki.name/blog/wp-content/uploads/2009/12/ESC-POS-Command-Guide.pdf[^] Page 102

Could you please clarify better how I'm going to send this command. Thanks
Albin Abel 17-Mar-11 7:12am    
using the RawPrinterHelper class RawPrinterHelper.SendStringToPrinter("GS V 48"); (m has a value) Use a generic text printer to send this raw data.
Albin Abel 17-Mar-11 7:30am    
output = Chr(&H1D) & "V" & Chr(66) & Chr(0) 'Feeds paper & cut
RawPrinterHelper.SendStringToPrinter(printerName, output)
This is the one from my old project for EPSON Thermal printer
samudebr 18-Mar-11 4:35am    
Sorry I didn't understand how I m going to send this:

output = Chr(&H1D) & "V" & Chr(66) & Chr(0);

Could explain what are you doing in this line of code (I'm using C#)?
Albin Abel 18-Mar-11 5:41am    
Through Generic Text Printer we are sending the ASCII commands to the printer. The command you have shown above 'Decimal 29 86 m' where I am chosen m value to 66, can use 65 also for full cut. So all these values we have convert to chars before send to printer. That is what that line does. As you are using c# you can use
string output = Convert.ToChar(29) + "V" + Convert.ToChar(65) + Convert.ToChar(0);
RawPrinterHelper.SendStringToPrinter(printerName, output);.
If 65 doesn't work then try with 66 as well. The printer name refer to a generic text printer. If you haven't set up a generic text printer then google may help how set a generic text printer depending upon your OS

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