Allow configurable commands for image printing #1364
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature that allows for configurable image printing commands, specifically for ESC/P printers.
Summary
Previously, QZ-Tray used command (
ESC *
) for printing images to ESC/P printers. This change introduces support for two additional, widely-used image printing commands:GS v 0
andGS ( L
.The primary goal is to offer better performance for image printing with alternative commands.
Key Changes
imageEncoding
option has been added to the print configuration. This allows users to specify which command set to use for image printing.ESC_STAR
(default): The originalESC *
command.GS_V_0
: TheGS v 0
command.GS_L
: TheGS ( L
command.GsV0Encoder.java
: Implements the logic for theGS v 0
command.GsLEncoder.java
: Implements the logic for theGS ( L
command.How to Use
To use one of the new image printing commands, add the
imageEncoding
option to your printing configuration. For example:If the
imageEncoding
option is not specified, the system will default toESC_STAR
to maintain backward compatibility with existing setups.