0
votes

I have prepared a small program for retail shop, and have to print out receipt (using tvs msp star 240 dot matrix printer/with paper roll) . with wx.Printout() class for printing , as print preview is ok but actual printing is different and awkward : 1. i m using paper roll n don't know how to call end printing/OnEndPrinting()/ cut paper ? 2. how to correct text shape or which font for actual printout ? I m new for programming ..... Please help and suggest appropriate code for this ... Thanks in advance !!

1

1 Answers

0
votes

Well i figure out some sort of solution : receipt printing is impossible with wxPython , so, raw printing with escape sequences would be better option os.system("echo ' some text ' | lpr -o raw" ) first initialize printer os.system("echo ' \x1B\x40' | lpr -o raw" ) for bold letters with ESC code : os.system("echo ' \x1BE some text \x1BF ' | lpr -o raw" ) for double width : os.system("echo ' \x1BW\01 some text ' | lpr -o raw" ) for underline os.system("echo ' \x1B\035 some text \x1B\034' | lpr -o raw" ) and many more options can be used with ESC code