Thermal receipts & shipping label silent print

Retail receipts, 80mm thermal tickets, and WMS shipping labels usually need silent output to a named thermal printer—no browser dialog. Describe layouts in HTML/CSS, then printHtml / batchPrint via web-print-pdf on Windows POS, Mac store PCs, and Linux/domestic warehouse desktops with one codebase.

Thermal / label print architecture

Describe paper in HTML/CSS. Local: browser printHtml / batchPrint. Remote peak: no npm—enqueue the same JSON on your server; desk client enters the consumer API URL (remote print, WMS push).

Typical scenarios

80mm receipt

Food & retail thermal tickets

Set pdfOptions width (e.g. 80mm), zero html/body margins to avoid extra pages. See the 80mm demo.

Shipping labels

WMS waybills / parcel labels

Push HTML or URLs from OMS; warehouse PCs batch silent-print. Pair with remote print. See batch labels demo.

Mixed fleet

Windows front + domestic OS back office

Same npm package: Windows exe and Kylin/UOS deb clients share the API—one print stack to maintain.

Integration steps

  1. Install the Web Print Expert client on POS/warehouse PCs
  2. npm install web-print-pdf
  3. Author HTML/CSS for paper width (zero margins on thermal)
  4. Call printHtml or batchPrint with printOptions.printerName
  5. High volume: enable remote WebSocket/HTTP push

80mm receipt parameter sketch

await webPrintPdf.printHtml(
  receiptHtml,
  { width: '80mm', height: '120mm', printBackground: true },
  { printerName: 'Thermal printer', copies: 1 }
);

Parameter checklist

  • Width: pdfOptions width/height (e.g. 80mm), not A4
  • Margins: html, body { margin:0; padding:0; } in HTML
  • Printer: printOptions.printerName from client enumeration
  • Batch: peak label volume via batchPrint—see print options guide

Choose by paper type

PaperpdfOptionsTypical use
80mm receiptwidth: 80mm, margin:0Food & retail POS
100×150 labelExact width/height, zero marginsShipping, WMS
A4 reportpaperFormat: A4See print options

Troubleshooting checklist

  • Blank/extra pages: body margin & pdfOptions height
  • Clipped content: paper narrower than fixed HTML width
  • Wrong printer: match printerName to client list
  • Mac/domestic OS: dmg/deb clients, same API as Windows

How this page fits with related guides

FAQ

Blank pages or extra pages on thermal paper?

Usually default body margins or oversized paper height. Follow the 80mm demo—zero margins and match pdfOptions to physical width.

Silent print labels without a browser dialog?

Yes with web-print-pdf + local client. window.print always shows a dialog.

ERP pushes jobs; warehouse auto-prints?

Yes—maintain jobs on your server, expose WebSocket/HTTP, and configure that URL on the desk client—not printHtml in a browser. See the remote print guide.

Mac stores or domestic Linux terminals?

Supported—official macOS dmg and Linux deb (Kylin/UOS) use the same printHtml API as Windows.

Migrate Lodop labels to HTML?

Many shipping labels suit HTML PoC; precision overlays can stay on Lodop in parallel. See parallel Lodop guide.

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