There are two types of printing techniques are in computer, One is DOS print and another is windows print. In windows print it uses the windows default printer but in DOS mode printing it prints directly to the printer.DOS mode printing is faster and is suitable for receipt printing
This DOS command will print your file to the printer
PRINT [/D:device] [/B:size] [/U:ticks1] [/M:ticks2] [/S:ticks3]
[/Q:qsize] [/T] [[drive:][path]filename[ ...]] [/C] [/P]
One easy way to print receipt is,
1, Save your receipt as a text file
2, Run command prompt in hidden using code and execute above DOS command with appropriate arguments
This will print only the receipt area not in whole page
Search in Google for more details about DOS mode print