Print options
Copies, paper, orientation, duplex, colour, quality, media type — plus what to do when an option does not apply.
Last updated
Every print option lives in options, and print() and preview() use them
identically.
await client.compose({ queueId })
.paper('A4') // paper
.copies(2) // copies
.duplex('long-edge') // duplex
.color(false) // mono
.addPdf(bytes)
.printAndWait();One job, one sheet size
paper is the single size for the whole job: with mixed content, every page
lands on that sheet.
If you omit it, PrintLink derives one and says which rule it used in
warnings:
| Case | Result |
|---|---|
| You set paper (or a profile does) | That size is used |
| Not set, all content pages are the same size | That size (paper follows content) |
| Not set, page sizes differ | The largest page, with MIXED_PAGE_SIZES_UNIFIED |
| Not set, only images / web pages | The printer default, else A4, with PAPER_DEFAULTED |
When unsure, glance at the preview window's status bar — it shows the size actually used, so there is nothing to guess.
Common options
| Option | Values | Notes |
|---|---|---|
copies | number | Repeated by the printer; thumbnails are not duplicated |
orientation | auto / portrait / landscape | Omitted means auto: landscape content gets a landscape sheet |
paper | auto or a paper object | See above |
tray | tray id or auto | Omitted means the printer default |
duplex | auto / one-sided / long-edge / short-edge | |
color | true colour / false mono | Omitted means the printer default |
quality | auto / draft / normal / high / best | See below |
mediaType | media type keyword | See "Media type" |
borderless | true / false | Borderless/full bleed. Omitted means the printer default |
collate | true / false | Collate multiple copies |
reverseOrder | true / false | Print in reverse order |
pageRange | e.g. '1-8' | Only some of the output pages |
The uniform spelling of "automatic": auto and omitting the option are
exactly equivalent — both mean "let PrintLink or the printer decide".
Switches (color, borderless, collate, reverseOrder) have no auto:
omitting means "use the printer default", so do not write false — the two
mean different things. For convenience, the strings 'true' / 'false' are also
accepted on input, but PrintLink always returns a boolean.
Quality
Quality has exactly four levels, in the API and in the UI:
| Value | Meaning |
|---|---|
draft | Economy — least ink, fastest |
normal | Standard |
high | High |
best | Best |
auto | Omitted or unset: the printer default |
Drivers call these things all sorts of names ("Economy mode", "Low-compression JPEG", "Best photo"), which means nothing to a caller. So PrintLink maps the four levels onto this printer's own levels by rank: economy is always the first, best always the last. On a 3-level machine "best" and "high" land on the same level — that is expected, and all four stay selectable.
To target one specific driver level, use outputQuality:
const caps = await client.getCapabilities(queueId);
caps.outputQuality?.supported; // the driver's own level keywords
caps.outputQuality?.names; // display names, for UI onlyWhen both are given, outputQuality wins. A printer that does not report this
layer will drop it with a warning rather than silently substituting something.
Quality does not select photo mode
Whether an inkjet enters photo mode (slow multi-pass, photo ink load) is decided
by the media type, not quality. Printing on photo paper with "plain paper"
selected comes out washed out and grainy, and noticeably faster. See the next
section.
Media type
For photo paper, transparencies and similar, set the media type as well:
const caps = await client.getCapabilities(queueId);
caps.mediaTypes?.supported; // keywords; put one straight into options.mediaTypeawait client.compose({ queueId })
.paper('4x6')
.mediaType('photographic-glossy')
.addImage(photoBytes)
.printAndWait();- The keyword is the submitted value; the names in
caps.mediaTypes.namesare for display only. - A printer that does not report media types still accepts the keyword but
returns
MEDIA_TYPE_UNVERIFIED. - Plain paper is
stationeryand is always available.
Image placement and size
The job-level pageLayout offers three uniform presets:
| Preset | Effect |
|---|---|
auto (default) | Scale to fit the printable area, centred, no cropping |
actual | Original size, centred, cropped where it overflows |
fill | Scale up to cover the printable area, cropping the overflow |
A single image can be adjusted precisely, affecting only that image:
await client.compose({ queueId })
.paper('A4')
.addImage(cover)
.imageLayout({
mode: 'custom',
horizontal: 'left', // left | center | right
vertical: 'top', // top | center | bottom
scalePercent: 80, // mutually exclusive with size
offset: { xMm: 10, yMm: 15 },
rotate: 90, // 0 | 90 | 180 | 270
flipHorizontal: true,
})
.addPdf(report) // unaffected by the above
.preview();Dragging, scaling, rotating and flipping in the preview window write back exactly this set of values for the current image.
Printing only some pages
pageRange applies to output pages (after merging) and is independent of any
per-item pageRange:
await client.compose({ queueId })
.paper('A4')
.addPdf(bytes).pageRange('2-4') // pages 2–4 of that PDF
.outputPageRange('1-2') // only the first 2 merged pages
.print();The syntax is 1-based, e.g. '1-3,5'. '3-1' or 'a-b' gives
INVALID_REQUEST; a partially out-of-range value is clamped with
PAGE_RANGE_CLAMPED.
When an option does not apply
PrintLink never silently drops options: if the printer does not support a value, it downgrades compatibly and reports structured warnings.
const check = await client.compose({ queueId }).paper('A3').addPdf(bytes).validate();
console.log(check.requested); // what you asked for
console.log(check.effective); // what will actually be used
console.log(check.warnings); // the differenceCall validate() before submitting so you can show the difference to the user
instead of finding out after printing. The console's Jobs page keeps the same
three sets of data for every job.
Common warnings:
| Warning | Cause |
|---|---|
UNSUPPORTED_PRINT_OPTION | The printer does not support this option; ignored or downgraded |
DUPLEX_NOT_SUPPORTED | No duplex support; printed one-sided |
COLOR_NOT_SUPPORTED | No colour support; printed mono |
MEDIA_TYPE_UNVERIFIED | The printer reports no media types, so the value cannot be confirmed |
PAPER_DEFAULTED | No paper given and none could be derived |
MIXED_PAGE_SIZES_UNIFIED | Content page sizes differed; unified to the largest |
PAGE_RANGE_CLAMPED | The page range overflowed and was clamped |
Full details in error codes.
Saving common settings
When one printer always uses the same options, save them as a profile and reference it:
await client.compose({ queueId }).profile(profileId).addDocument(doc).print();See printers & profiles.