v147 · proposed IWA API · member reference
WebPrinter.submitPrintJob()
Submits one PDF job. This stable route intentionally replaces the old overview’s unsupported printJob() spelling: the current normative and Chromium method name is submitPrintJob().
Syntax
printer.submitPrintJob(jobName, documentData, attributes)
// Promise<WebPrintJob>Inputs
jobName is a USVString. documentData is a Blob containing a valid PDF; the only enumerated document format is application/pdf. attributes is a WebPrintJobTemplateAttributes dictionary; Chromium’s current binding requires that third argument even though the spec makes it optional with {}. Pass values advertised by fetchAttributes().
Outputs
Resolves when the browser has submitted the job and created a WebPrintJob. It does not resolve when physical printing finishes; observe the returned job.
Errors
Normative: unreachable printer → rejected NetworkError; unsupported requested capability or malformed PDF → rejected DataError. Chromium also rejects NotAllowedError for denied access. Before dispatch it throws TypeError for copies < 1, missing/zero resolution directions, or non-positive/out-of-range requested media dimensions; invalid Web IDL values also throw TypeError.
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
Submission refreshes capabilities before matching attributes in the normative algorithm. Use an AbortSignal in the attributes to request cancellation after a job object exists; aborting is best effort and no success/settlement guarantee is defined. Retrying can duplicate printed output, so only retry after user confirmation.
Examples
async function submitPdf(printer, pdfResponse) {
const documentData = await pdfResponse.blob();
if (documentData.type && documentData.type !== "application/pdf") {
throw new TypeError("Expected an application/pdf response");
}
const capabilities = await printer.fetchAttributes();
if (!capabilities.documentFormatSupported?.includes("application/pdf")) {
throw new Error("Printer did not report PDF support");
}
return printer.submitPrintJob("Monthly report", documentData, {
copies: 1,
sides: "one-sided",
});
}Browser compatibility
| Runtime | Status | Evidence |
|---|---|---|
| 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 service | Implemented only when built with IS_CHROMEOS && USE_CUPS; otherwise getPrinters() has no service and throws SecurityError. | Chromium manager implementation |
| Android / mobile | ChromeStatus 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 |
| Firefox | No signal; no BCD member record found. | ChromeStatus position; BCD API data |
| Safari | No signal; no BCD member record found. | ChromeStatus position; BCD API data |
| webstatus.dev | No 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.