vs looping printHtml?
Client-side queue—fewer round trips.
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.
batchPrint(list, pdfOptions?, printOptions?, extraOptions?)| Rule | Notes |
|---|---|
| Defaults | Args 2–4 apply to all tasks |
| Override | Per-task pdf/printOptions win |
import webPrintPdf from 'web-print-pdf';
await webPrintPdf.batchPrint(
orders.map((o) => ({ html: renderLabel(o) })),
{ width: '100mm', height: '150mm' },
{ printerName: 'Thermal-1' }
);| Pattern | Use when |
|---|---|
| Defaults + few overrides | Same-size label wave |
| Full per-task options | Mixed month-end reports |
| Server push array | WMS unattended |
Client-side queue—fewer round trips.
Yes—override printOptions per task.
Inspect results + formatPrintError.
Optional if each task is complete.
Remote push enqueues fixed-format JSON (type may be batchPrint); client consumes via your API—not browser batchPrint. See batchPrint API for field mapping.
The same web-print-pdf front-end runs on Windows, macOS, and Linux/domestic OS—install the matching client on each desktop.