python-escpos icon indicating copy to clipboard operation
python-escpos copied to clipboard

Use with CUPS

Open beaucox opened this issue 7 years ago • 4 comments

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

beaucox avatar Apr 28 '17 07:04 beaucox

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)

patkan avatar May 02 '17 11:05 patkan

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.

patkan avatar May 14 '17 20:05 patkan

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

belono avatar Jun 18 '19 21:06 belono

Thank you, I would appreciate that :-)

patkan avatar Jun 19 '19 11:06 patkan