chunlinyao / rastertoescpos

Raster to ESC/POS CUPS Driver for receipt printer
GNU General Public License v3.0
22 stars 7 forks source link

Could you plz give some example code to use? #1

Open red010182 opened 7 years ago

red010182 commented 7 years ago

I'm using a mac and totally new to CUPS and thermal printer(support ESC/POS).

I installed this lib, and then, how can I print something?

I use echo hi | lp to print, it turns out that the printer prints lots of things like source code, really a lot. Needless to say printing a file. Hope I can find the answer here.

Thank you.

chunlinyao commented 7 years ago

This is a CUPS driver, so if you installed a printer and use this driver, normal print command will work. no special source code is required. If printer output some garbage, maybe the driver sent some commands your printer don't understand. You should check your printer's manual if all command used by this driver is supported by your printer.

red010182 commented 7 years ago

Thanks for replay. I worked it out by using this command lpr -o raw test.txt. It now prints correctly, however, it can't print anything correctly out of askii code. I tried to transcript the file into UTF8 format using paps command. But my printer somehow cannot accept .ps(postscript) file directly sent from lpr command. I'm sure this printer support esc/pos command, just don't know how to work it out.

Thank you anyway, I'll keep trying.

2017-04-16 6:49 GMT+08:00 chunlinyao notifications@github.com:

This is a CUPS driver, so if you installed a printer and use this driver, normal print command will work. no special source code is required. If printer output some garbage, maybe the driver sent some commands your printer don't understand. You should check your printer's manual if all command used by this driver is supported by your printer.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/chunlinyao/rastertoescpos/issues/1#issuecomment-294322306, or mute the thread https://github.com/notifications/unsubscribe-auth/ACBNR7oCF0xFOxBac7sndt51dOHRweVnks5rwUmIgaJpZM4M-ZBH .