-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image printing sometimes prints random characters #51
Comments
Hi @AlbertoVillagomez, and we need to make effort to reproduce the error. one point of attention is that the lib operations isn't thread-safe. is your application multithreaded? |
Hi @anastaciocintra |
Ok, |
Yes, I just need to reprint it for it to work |
But I'm curious in why this is printing such characters from time to time |
is it image fixed for all printed tickets or you buid one custom image for eachone? |
@AlbertoVillagomez, |
Yes, it is always the same image. |
that happens to me too. once in five (more or less) instead of printing the image it prints random characters. But only by usb. By ethernet it always prints well. Is it the fault of my drivers and my printer?: https://postimg.cc/8sNF7BZx |
I'm facing the same problem, but it's not related with this library. Did anyone, @AlbertoVillagomez or @palanganero, discovered what is causing this? |
Hi guys, I'm facing the same issue... I'm using a STAR printer, the model is SK1-311. This printer works with ESC/POS commands and also StarPRNT commands, I've been testing the printer with this library and it works even using it in the StarPRNT function, but I can't print images. My code is too simple
|
I experienced this issue, and it was remedied by changing which implementation of the escpos.Image function. I was originally using bitImageRaster (the default implementation) and switched to bitImageColumn which has been performing well ever since (knock on wood). Specifically, in the docs, you are looking for
You can select whether the printer should print in high density or not. The default value is high density. When printing in low density, the image will be stretched. Esc/Pos supplies several commands for printing. This function supports three of them. Please try to vary the implementations if you have any problems. For example the printer IT80-002 will have trouble aligning images that are not printed in Column-mode. The available printing implementations are: bitImageRaster: prints with the GS v 0-command graphics: prints with the GS ( L-command bitImageColumn: prints with the ESC *-command When trying to center an image make sure you have initialized the printer with a valid profile, that contains a media width pixel field. Otherwise the centering will have no effect. Parameters high_density_vertical (bool) – print in high density in vertical direction default: True high_density_horizontal (bool) – print in high density in horizontal direction default: True impl (str) – choose image printing mode between bitImageRaster, graphics or bitImageColumn fragment_height (int) – Images larger than this will be split into multiple fragments default: 960 center (bool) – Center image horizontally default: False Return type |
When printing a ticket which has a logo, sometimes I get a bunch of random characters.
My code is packaged as an executable jar file
My logo image is: 300 px width and 250 px height
Thermal printer: Sanbee mini 58 mm
Code sample
As you can see I load the image just once the first time it is needed as a "BufferedImage", my thinking (which was wrong) was that maybe the read operation was causing the issue.
Any ideas on this?
The text was updated successfully, but these errors were encountered: