← Web Printing API

v147 · proposed IWA API · member reference

WebPrintJobTemplateAttributes

The typed job-request dictionary passed as the third argument to submitPrintJob(). It is not an arbitrary IPP key/value map.

Proposal and implementation differ from the old overviewChromeStatus currently records this API as Proposed, not shipped. This reference follows the current WICG IDL and Chromium source; test in the intended IWA configuration and feature-detect rather than relying on the v147 label.

Syntax

const attributes = {
  copies: 1,
  mediaCol: { mediaSize: { xDimension: 21000, yDimension: 29700 } },
  mediaSource: "auto",
  multipleDocumentHandling: "separate-documents-collated-copies",
  orientationRequested: "portrait",
  printerResolution: { crossFeedDirectionResolution: 300,
    feedDirectionResolution: 300, units: "dots-per-inch" },
  printColorMode: "monochrome", printQuality: "normal",
  sides: "one-sided", signal: controller.signal,
};

Inputs

All fields are optional in current spec: copies, mediaCol, mediaSource, multipleDocumentHandling, orientationRequested, printerResolution, printColorMode, printQuality, sides, and signal. mediaCol.mediaSize.xDimension and yDimension are required if mediaCol exists. Current Chromium converts omitted copies to 1; this implementation default is not stated by the WICG IDL.

Outputs

It controls the submitted job. A matching request returns a job handle; an unsupported one rejects submission.

Errors

Chromium throws TypeError for copies below 1, incomplete/zero resolution, or non-positive dimensions. The normative algorithm rejects DataError when any requested value is unsupported. Unknown dictionary members are ignored by normal Web IDL dictionary conversion; do not rely on them.

Context and permission

The IDL requires a secure, isolated context. The specification also defines the web-printing Permissions Policy with default allowlist self; Chromium additionally checks an isolated context and cross-origin isolation before getPrinters(). The current proposal requires express, origin-specific consent triggered by enumeration. The exact chooser scope, persistence, and whether a later operation prompts again remain user-agent UX, not a settled web contract.

Lifecycle, cancellation, and cleanup

Compare against freshly fetched capability fields, submit once, then observe the job. signal wires abort to job cancellation after creation; it is not documented as cancellation of the promise before a job exists.

Examples

const caps = await printer.fetchAttributes();
const mode = caps.printColorModeSupported?.includes("monochrome")
  ? "monochrome" : caps.printColorModeDefault;
const job = await printer.submitPrintJob("Receipt", pdfBlob, {
  copies: 1, printColorMode: mode, sides: "one-sided",
});

Browser compatibility

Current public compatibility evidence (checked 2026-07-26)
RuntimeStatusEvidence
Chrome (general)Proposed and not released. ChromeStatus lists I2S desktop target 147, which is not release proof. Do not infer general desktop Chrome support.ChromeStatus
Current Chromium serviceImplemented only when built with IS_CHROMEOS && USE_CUPS; otherwise getPrinters() has no service and throws SecurityError.Chromium manager implementation
Android / mobileChromeStatus Android is null; no public mobile release exists. The current ChromeOS+CUPS-only service path does not expose the service on Android.ChromeStatus; implementation guard
FirefoxNo signal; no BCD member record found.ChromeStatus position; BCD API data
SafariNo signal; no BCD member record found.ChromeStatus position; BCD API data
webstatus.devNo feature entry found for this query; this is not proof of absence from browsers.webstatus query

Security and privacy

Printer names, IDs, capabilities and state can fingerprint a device and reveal printing activity. A compromised IWA could create unwanted jobs or denial of service. Minimize enumeration and polling, do not expose attributes to untrusted content, validate documents before submitting, and offer an app-level confirmation/audit trail. The spec requires isolation and consent; it does not make printer information non-sensitive.

Canonical sources