rtu-dataframe / escposprinter Goto Github PK
View Code? Open in Web Editor NEWThe most famous ESCPOS printer library, now for Python 3!
The most famous ESCPOS printer library, now for Python 3!
Hello there,
So I'm attempting this printer via USB and I seem to facing an issue where it insists the cable isn't plugged, spouting that a NoneType object has no attribute "is_kernel_driver_active", etc,
Now the device is 100% plugged in and will work as a standard printer, however I just can't seem to get it to play along with this module.
I'm using the following line to attempt to connect:
Epson = printer.Usb(0x04b8,0x0e20)
04b8 being the VendorId and 0e20 being the ProductId, which would be the correct information according on USBDeview.
First time using such a piece of kit so quite possible I've missed something obvious, though if you could point me in the right direction that'd be appreciated.
Thanks
I currently have a sort of makeshift queue system which pushes the most recent request to my printer of choice (Munbyn ITPP047), however I find that after each cut(), the printer takes around 4 seconds or so before proceeding with the next one, whereas ideally we'd be looking at around the 1 second mark, or even immediate after if possible,
I'm unable to find any limitations with the printer software itself so wasn't sure if this is within the module, or even pyusb itself, and perhaps there may be a solution or perhaps a workaround to get this delay taken care of.
Hi does this work with intermec?
I am trying this
from escpos.printer import Network
try:
kitchen = Network("192.168.1.16") #Printer IP Address
kitchen.text("Hello World\n")
kitchen.barcode('4006381333931', 'EAN13', 64, 2, '', '')
kitchen.cut()
print('print sent')
except Exception as e:
print(e)
Get print sent returned, no errors but nothing to printer. IP address is correct. any ideas?
I'm trying to use escposprinter in a RaspberryPi 3 with the very latest Raspbian (released just a few days ago) and an Epson TM-T20 II printer.
Printing text works just fine and is quite fast but printing an image is excruciatingly slow.
This is for a ticketing system, so what I'm doing is using PIL to load a white image (previously created with the right dimensions for the purpose: 400x210), drawing the text over the image and saving it to a temporary file. Then I call Escpos.image() and pass it the path to the temporary image. I'm attaching an example here.
It works and the image gets printed but very, very slowly.
When the printer finishes, it seems like the image was divided in rows and each row was printed individually. You can even hear the printer printing each individual row and see the thin blank lines between each filled/drawn row.
Any clue as to why this may be happening and how to fix it?
Here's the code I'm using:
def printQueue(queue_number, queue_line):
# Base white image where text is to be printed
img = Image.open(original_img)
draw = ImageDraw.Draw(img)
font = ImageFont.truetype("/usr/share/fonts/truetype/roboto/RobotoCondensed-Bold.ttf", 110)
queue_text = queue_line + ' ' + queue_number
draw.text((190, 0), queue_text, (0, 0, 0), font=font)
img.save(temp_img)
with EscposIO(printer.Usb(0x04b8, 0x0e15)) as p:
p.printer.image(temp_img)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.