• Download
  • Demo
  • Buy
  • API
  • Docs
  • Support
  • About
  • Contact
  • Login
API Home
Namespaces
qzapiconfigsfilehidnetworkingprinterssecurityserialsocketusbwebsocket
API Home
Namespaces
qzapiconfigsfilehidnetworkingprinterssecurityserialsocketusbwebsocket

Namespace: configs

qz.configs

Calls related to setting up new printer configurations.
Source:
  • qz-tray.js, line 1619

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:
  • qz-tray.js, line 1702
See:
  • configs.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
bounds Object <optional>
null Bounding box rectangle.
Properties
Name Type Attributes Default Description
x number <optional>
0 Distance from left for bounding box starting corner
y number <optional>
0 Distance from top for bounding box starting corner
width number <optional>
0 Width of bounding box
height number <optional>
0 Height of bounding box
colorType string <optional>
'color' Valid values [color | grayscale | blackwhite | default]
copies number <optional>
1 Number of copies to be printed.
density number | Array.<number> | Object | Array.<Object> | string <optional>
0 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). If provided as a string, valid values are [best | draft], corresponding to highest or lowest reported density respectively.
Properties
Name Type Attributes Default Description
cross number <optional>
0 Asymmetric pixel density for the cross feed direction.
feed number <optional>
0 Asymmetric pixel density for the feed direction.
duplex boolean | string <optional>
false Double sided printing, Can specify duplex style by passing a string value: [one-sided | duplex | long-edge | tumble | short-edge | null] If set to null, duplex will be determined automatically.
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 | null]. If set to null, orientation will be determined automatically.
paperThickness number <optional>
null
printerTray string | number <optional>
null Printer tray to pull from. The number N assumes string equivalent of 'Tray N'. Uses printer default if NULL.
rasterize boolean <optional>
false Whether documents should be rasterized before printing. Specifying [options.density] for PDF print formats will set this to true.
rotation number <optional>
0 Image rotation in degrees.
scaleContent boolean <optional>
true Scales print content to page size, keeping ratio.
size Object | string <optional>
null Paper size. For PDF, if inherit is specified, size information is read from the PDF page dimensions. Inherited sizes ignore size.width, size.height, options.units but honor options.margins.
Properties
Name Type Attributes Default Description
width number <optional>
null Page width.
height number <optional>
null Page height.
custom boolean <optional>
false If the provided page size is not included in the driver.
units string <optional>
'in' Page units, applies to paper size, margins, and density. Valid value [in | cm | mm]
forceRaw boolean <optional>
false Print the specified raw data using direct method, skipping the driver. Not yet supported on Windows.
encoding string | Object <optional>
null Character set for commands. Can be provided as an object for converting encoding types for RAW types.
Properties
Name Type Attributes Description
from string <optional>
If this encoding type is provided, RAW type commands will be parsed from this for the purpose of being converted to the encoding.to value.
to string <optional>
Encoding RAW type commands will be converted into. If encoding.from is not provided, this will be treated as if a string was passed for encoding.
endOfDoc string <optional>
null DEPRECATED Raw only: Character(s) denoting end of a page to control spooling.
perSpool number <optional>
1 DEPRECATED: Raw only: Number of pages per spool.
retainTemp boolean <optional>
false Retain any temporary files used. Ignored unless forceRaw true.
spool Object <optional>
null Advanced spooling options.
Properties
Name Type Attributes Default Description
size number <optional>
null Number of pages per spool. Default is no limit. If spool.end is provided, defaults to 1
end string <optional>
null Raw only: Character(s) denoting end of a page to control spooling.
Source:
  • qz-tray.js, line 1682
Documentation generated by JSDoc 3.6.11

© 2026 qz | Privacy Policy