Closed lorro closed 5 years ago
@lorro
Can you share some more information about your environment?
What Operating System?
If raw text works fine and HTML does not, this can occur on MacOS or Linux, where the driver for HTML is normally different from the raw driver.
What make/model printer?
I.E.: Some printers use Epson drivers or Zebra drivers, even though they are not manufactured by Epson or Zebra. Alternately, you may print to PDF in MacOS or Linux, or use Microsoft's XPS Document Writer to test functionality.
What version of Java?
QZ-Tray requires Java 8 for HTML printing, and JavaFX must be installed to generate the HTML content. We recommend using the off-line 64-bit installer.
All of this being said, it is worth noting that the 2.1 branch will soon be stable, and its HTML printing quality is much better than 2.0.8.
I'm working on a Win10 installation as OS. Developing an app on localhost. My label printer is a Citizen TZ30-M01 JRE is 1.8 (Java SE 11, JavaFX should be included according to the oracle site)
Is there a windows executable available of this 2.1 version perhaps?
By the way, I just tried compiling this 2.1 branch but get the following error. error: package com.sun.javafx.print does not exist
So I guess it has something to do with JavaFX, perhaps you can supply a direct link to the download of the correct Java package? I only find links to the latest Java SE (which states JavaFX is included)
Thanks
https://java.com/en/download/manual.jsp
The Off-line installer should be the third link in the page linked above :)
If JavaFX is not installed or the current installation is corrupted, you will not be successful with HTML printing in either 2.0 or 2.1
Can you confirm that the Windows Test Print to this printer is successful?
I just tried compiling this 2.1 branch but get the following error.
Please use Java JDK 8. Java's trying to push newer JDK's and they're abandoning JavaFX from the default runtime.
I can print raw text without a problem but when I try printing some plain HTML, I see a small java popup for about a second before it disappears again. Nothing is printed.
If you're using "Generic/Text" driver, you can't print HTML. Which driver are you using?
Is there a windows executable available of this 2.1 version perhaps?
You shouldn't have to compile, use this version of 2.1: https://github.com/tresf/tray/releases/tag/v2.1.0-RC5
If you're using "Generic/Text" driver, you can't print HTML. Which driver are you using?
Which driver should it be instead? I'm indeed using this Generic/Text driver for the labelprinter.
alright nevermind. I got the correct drivers for this specific printer from someone and now it does print some html (though quite pixelated). But for some reason it opens the cash drawer automatically ^^
The pixelation should be fixed by using the beta of 2.1 and using { rasterize: false }
configuration option. This option is new for HTML starting with 2.1.
2.1 beta can be downloaded here: https://github.com/tresf/tray/releases/tag/v2.1.0-RC5
Note 2.1 is not compatible with the latest version of Firefox. This will be fixed in a future release.
The cash drawer opening automatically is a driver setting. The driver is sending a pulse to the cash drawer by default. You can turn this off if undesired. We're not yet familiar with the Citizen drivers so you'll have to locate this in the driver preferences. Feel free to share screenshots here so others can learn.
That's correct :-) I found the setting in the advanced settings of the Citizen drivers.
I still do have some issues with HTML printing quality apparently.
This is printed using
{
type: 'pixel',
format: 'html',
flavor: 'plain',
data: '<img src="static/images/vaporshop-logo.jpg" />'
}
This is printed using
{
type: 'raw',
format: 'image',
data: 'static/images/vaporshop-logo.jpg',
options: {
language: 'ESCPOS',
dotDensity: 'double'
}
}
You see it's far more sharper. But yeah, not all the visuals of the logo are shown. Just to illustrate the difference in print quality :)
Printing it with 'image' as type gives the same blurry quality, only the image is displayed a bit larger than in the first image.
The title of this issue mentions HTML, not images. If printing images, special consideration should be made to:
If using HTML, you'll have the luxury of allowing the driver to do the dithering, etc. Raw and Pixel are two completely different underlying technologies. In 2.1 we do have a technique for transferring HTML and PDFs directly to raw -- eliminating the need to switch technologies -- but it's not well documented. Note that with RAW, no driver is needed and to that point -- with raw -- you shouldn't need to touch the cash drawer settings, you'd be using a pulse code instead. https://qz.io/wiki/2.0-Raw-Printing#escpos
Ok, i'll try that :) We'll only have to use an image for the logo. Almost getting there I think. Still one small issue with printing html. The quality good is good when settings 'rasterize' to false, but it messes a bit with the margin
The receipt on top is with 'rasterize' set to false, but has some text cut off. The default one (pixelated) do have correct margin.
Can you please share your HTML with us and we'll provide a working example with correct margins for our receipt printers?
Hi,
It's this quite basic html snippet
{
type: 'pixel',
format: 'html',
flavor: 'plain',
data:
`<p>Hi, I'm some HTML text</p>
<p>Second line of HTML text</p>
<p>Third line of html text</p>
`
}
Thanks for sharing. We recommend using <html>
tags around your content for proper markup. We'll test on our equipment and let you know.
@lorro Are you using 2.0.8 or 2.1 beta?
I have a variety of thermal printers to test on:
Epson TM-T88V, TM-T88VM, TM-T88VI Citizen CBM 1000 Star TSP 650II Fukun POS80
I'll be happy to test on another model if you wish, but I will proceed with the TM-T88V otherwise.
I will note that in the Epson driver, I have my page size set to 80x3276mm
I'm using the beta :)
I've set the left margin to 0.10 and now all the printing fine! margins: { top: 0.25, right: 0.10, bottom: 0.25, left: 0.10 }
Thanks for all the kind support! ;-)
Thanks for the update!
Hi,
I'm in the phase of figuring out if QZ Tray would work for me before actually buying a license. I'm trying to print out some basic html, but it isn't quite working out.
I can print raw text without a problem but when I try printing some plain HTML, I see a small java popup for about a second before it disappears again. Nothing is printed.
This is how my printing function looks like:
This is what the logs tell me:
Any idea what I could be doing wrongly? Or is this not possible in the free version? I'm using version 2.0.8 by the way.
Thanks