Skip to content

Add option to use "GS v 0" for ESC/POS image printing (Raw Printing) #1362

@wahyubaskara

Description

@wahyubaskara

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions