Skip to content

Commit

Permalink
Added 'default' ColorType
Browse files Browse the repository at this point in the history
  • Loading branch information
Vzor- committed Apr 3, 2024
1 parent 6e1a503 commit 093b56b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/qz-tray.js
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,7 @@ var qz = (function() {
* @param {number} [options.bounds.y=0] Distance from top for bounding box starting corner
* @param {number} [options.bounds.width=0] Width of bounding box
* @param {number} [options.bounds.height=0] Height of bounding box
* @param {string} [options.colorType='color'] Valid values <code>[color | grayscale | blackwhite]</code>
* @param {string} [options.colorType='color'] Valid values <code>[color | grayscale | blackwhite | default]</code>
* @param {number} [options.copies=1] Number of copies to be printed.
* @param {number|Array<number>|Object|Array<Object>|string} [options.density=0] Pixel density (DPI, DPMM, or DPCM depending on <code>[options.units]</code>).
* If provided as an array, uses the first supported density found (or the first entry if none found).
Expand Down
1 change: 1 addition & 0 deletions sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ <h3>Pixel Printing</h3>
<option value="color">Color</option>
<option value="grayscale">Grayscale</option>
<option value="blackwhite">Black & White</option>
<option value="default">Default</option>
</select>
</div>

Expand Down
3 changes: 2 additions & 1 deletion src/qz/printer/PrintOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,8 @@ public enum ColorType {
COLOR(Chromaticity.COLOR),
GREYSCALE(Chromaticity.MONOCHROME),
GRAYSCALE(Chromaticity.MONOCHROME),
BLACKWHITE(Chromaticity.MONOCHROME);
BLACKWHITE(Chromaticity.MONOCHROME),
DEFAULT(null);

private final Chromaticity chromatic;

Expand Down
2 changes: 1 addition & 1 deletion src/qz/printer/action/PrintPixel.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected PrintRequestAttributeSet applyDefaultSettings(PrintOptions.Pixel pxlOp
PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();

//apply general attributes
if (pxlOpts.getColorType() != null) {
if (pxlOpts.getColorType().getAsChromaticity() != null) {
attributes.add(pxlOpts.getColorType().getAsChromaticity());
}
attributes.add(pxlOpts.getDuplex());
Expand Down

0 comments on commit 093b56b

Please sign in to comment.