python-escpos
python-escpos copied to clipboard
Use with CUPS
I have:
- [ ] searched open and closed issues for duplicates
My setup
- installed as a CUPS printer
- installed pycups
- I can manually create a file and print successfully to the printer with 'lp -d PRINTER file'
What I can't figure out
- attach my cups printer to python-escpos directly w/o printing to a file and then doing 'lp ...'
Device info
Printer: CITIZEN/CT-S310II
python-escpos version: 2.2.0
python version: Python 3.4.2
operating system: Linux rpi-two 4.4.50-v7+ #970 SMP Mon Feb 20 19:18:29 GMT 2017 armv7l GNU/Linux ARM Debian 8.0 (Raspbian Jessie)
Any help would be appreciated. Beau
Hi @beaucox are you able to directly send strings to your printer with pycups? For example read a file and then print this with pycups. As soon as you know how to do this, extending python-escpos should be rather easy. You could just use the File-printer as a template. As an alternative: in the library is also the "dummy"-Printer available. With this you can just create a string which you can the use to communicate with your printer. (I unfortunately can't help you with the usage of pycups)
This issue should be solved by adding a printer connector similar to https://github.com/mike42/escpos-php/blob/development/src/Mike42/Escpos/PrintConnectors/CupsPrintConnector.php (which is based on calling lp
)
Alternatively it could be implemented by using pyCUPS.
I'm trying to implement a pycups printer connector and hope to make a PR for testing and enhancement in a few days.
I think it would be great to have it in v3.0 together with #320
Thank you, I would appreciate that :-)