Click here to Skip to main content
12,511,383 members (132,385 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
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 16-Mar-11 22:53pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
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
AlbinAbel 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.
AlbinAbel 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#)?
AlbinAbel 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
samudebr 18-Mar-11 7:09am
   
It worked finally!!!

Thanks a lot for your help.
AlbinAbel 18-Mar-11 7:13am
   
You are welcome samudebr.
samudebr 21-Mar-11 14:04pm
   
Hi AlbinAbel,

Sorry for disturbing you again, but I have another problem:

http://nicholas.piasecki.name/blog/wp-content/uploads/2009/12/ESC-POS-Command-Guide.pdf
Page 94, 36

I need to set printing speed because the cutter is not always cutting all the paper. I can't understand the command, also the same problem for the font. I think if you can explain one them I can manage to do the other one.

Thanks for your help.
Javier Bisono 31-Oct-14 15:47pm
   
Hi Samudebr and AlbinAble, I have a few days breaking my head trying to get the code to set bigger font and bold fonts on my Epson TM-T88IIP, if are able to help me please let me know, my email BisonoJavier@hotmail.com.
I already copied your code related to cutting the paper and it is working perfectly on my code. THANKS A LOT, I REALLY APPRECIATE YOUR HELP.
shanmugamvasu 27-Sep-12 7:58am
   
Please help how send the string for Changing font in EPSON thermal Printer:

font Selection
-----------------------------------------------------------------------------------
ASCII Dec Hex Description
-----------------------------------------------------------------------------------
ESC k n 107 6B Select Typeface
n=0: Roman 4: Script
1: Sans Serif 10: Roman T
2: Courier 11: Sans Serif H
3: Prestige
------------------------------------------------------------------------------------
what is the string for change the font to Courier. Any suggestion would be helpful.
Espen Harlinn 17-Mar-11 7:59am
   
POS is good, my 5
AlbinAbel 17-Mar-11 13:19pm
   
Thanks Espen Harlinn
sahabiswarup 25-Jan-13 1:37am
   
I'm using CITIZEN Thermal Printer; and also have the printer command with me. but it isn't work at all.
Can you please share your experience for the above printer.

Thanks.
Serenity1 12-May-15 2:33am
   
Any chance of re-uploading the pdf?

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160929.1 | Last Updated 12 May 2015
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100