Namespace: configs

qz.configs

Calls related to setting up new printer configurations.
Source:

Methods

(static) create(printer, optionsopt) → {Config}

Creates new printer config to be used in printing.
Parameters:
Name Type Attributes Description
printer string | object Name of printer. Use object type to specify printing to file or host.
Properties
Name Type Attributes Description
name string <optional>
Name of printer to send printing.
file string <optional>
Name of file to send printing.
host string <optional>
IP address or host name to send printing.
port string <optional>
Port used by <printer.host>.
options Object <optional>
Override any of the default options for this config only.
Source:
See:
  • config.setDefaults
Returns:
The new config.
Type
Config

(static) setDefaults(options)

Default options used by new configs if not overridden. Setting a value to NULL will use the printer's default options. Updating these will not update the options on any created config.
Parameters:
Name Type Description
options Object Default options used by printer configs if not overridden.
Properties
Name Type Attributes Default Description
colorType string <optional>
'color' Valid values [color | grayscale | blackwhite]
copies number <optional>
1 Number of copies to be printed.
density number | Array.<number> <optional>
72 Pixel density (DPI, DPMM, or DPCM depending on [options.units]). If provided as an array, uses the first supported density found (or the first entry if none found).
duplex boolean <optional>
false Double sided printing
fallbackDensity number <optional>
null Value used when default density value cannot be read, or in cases where reported as "Normal" by the driver, (in DPI, DPMM, or DPCM depending on [options.units]).
interpolation string <optional>
'bicubic' Valid values [bicubic | bilinear | nearest-neighbor]. Controls how images are handled when resized.
jobName string <optional>
null Name to display in print queue.
legacy boolean <optional>
false If legacy style printing should be used.
margins Object | number <optional>
0 If just a number is provided, it is used as the margin for all sides.
Properties
Name Type Attributes Default Description
top number <optional>
0
right number <optional>
0
bottom number <optional>
0
left number <optional>
0
orientation string <optional>
null Valid values [portrait | landscape | reverse-landscape]
paperThickness number <optional>
null
printerTray string <optional>
null //TODO - string?
rasterize boolean <optional>
true Whether documents should be rasterized before printing. Forced TRUE if [options.density] is specified.
rotation number <optional>
0 Image rotation in degrees.
scaleContent boolean <optional>
true Scales print content to page size, keeping ratio.
size Object <optional>
null Paper size.
Properties
Name Type Attributes Default Description
width number <optional>
null Page width.
height number <optional>
null Page height.
units string <optional>
'in' Page units, applies to paper size, margins, and density. Valid value [in | cm | mm]
altPrinting boolean <optional>
false Print the specified file using CUPS command line arguments. Has no effect on Windows.
encoding string <optional>
null Character set
endOfDoc string <optional>
null
perSpool number <optional>
1 Number of pages per spool.
Source: