-
Notifications
You must be signed in to change notification settings - Fork 311
Description
When printing images with the ESCPOS language type, QZ Tray's ImageWrapper class converts the image into raw printer commands. Currently, it exclusively uses the "ESC *" (bit-image) command. This is a widely supported command, but it's not always the most efficient or capable, especially on modern printers.
Many Epson printers and compatible models also support the GS v 0 command, which can offer better performance, handle larger image data, and is often the recommended method for printing graphics. The current implementation does not allow the user to select this alternative command.
I would like to propose adding a new option to the print configuration that allows the user to specify which command QZ Tray should use for image conversion.
For example, a new option like imageCommand could be added:
qz.print(config, [
{
type: 'raw',
format: 'image',
flavor: 'file',
data: 'https://example.com/example.png',
options: {
language: 'ESCPOS',
imageCommand: 'gs_v_0', // New option
},
},
]);
- When imageCommand is set to 'gs_v_0', QZ Tray would generate the necessary GS v 0 (store graphics) and GS ( L (print graphics) commands.
- If the option is not provided, it would default to the current behavior, using ESC * for backward compatibility.
Adding this feature would provide developers with more control over the printer output, allowing them to leverage the best features of their specific hardware. This would lead to improved print speed and quality for supported printers, making QZ Tray even more versatile.