batchPrint API reference & merge rules

batchPrint runs multiple jobs with batch defaults (args 2–4) and per-task overrides. Deep guide for label waves, month-end batches, performance vs printHtml loops, and technical evaluation.

Signature

batchPrint(list, pdfOptions?, printOptions?, extraOptions?)

Parameters

RuleNotes
DefaultsArgs 2–4 apply to all tasks
OverridePer-task pdf/printOptions win

Code example

import webPrintPdf from 'web-print-pdf';

await webPrintPdf.batchPrint(
  orders.map((o) => ({ html: renderLabel(o) })),
  { width: '100mm', height: '150mm' },
  { printerName: 'Thermal-1' }
);

Common patterns

PatternUse when
Defaults + few overridesSame-size label wave
Full per-task optionsMixed month-end reports
Server push arrayWMS unattended

When to use

  • Label waves, month-end batches
  • Prefer over printHtml loops at peak

Common pitfalls

  • Mixed paper sizes—override pdfOptions per task
  • Inspect batch results; use formatPrintError
  • Split huge arrays server-side

Technical lead checklist

  • Prefer batchPrint over tight printHtml loops at >500 jobs/day
  • Remote push uses the fixed message format; server handles receive/store/expose
  • License per desk client, not per batch call

Read next

FAQ

vs looping printHtml?

Client-side queue—fewer round trips.

Different printers per task?

Yes—override printOptions per task.

Partial failures?

Inspect results + formatPrintError.

Defaults required?

Optional if each task is complete.

Remote push batch?

Remote push enqueues fixed-format JSON (type may be batchPrint); client consumes via your API—not browser batchPrint. See batchPrint API for field mapping.

Client deployment by platform

The same web-print-pdf front-end runs on Windows, macOS, and Linux/domestic OS—install the matching client on each desktop.

Download client — free trial View npm package Documentation