Medical prescriptions & pharmacy label silent print

HIS systems often need A4 prescriptions and small pharmacy labels without browser dialogs. Use HTML/CSS + printHtml / batchPrint via web-print-pdf on Win/Mac/domestic desktops.

Print architecture

Business HTML → printHtml → local WebSocket client → PDF → silent printer output.

Typical scenarios

A4 Rx

Outpatient/inpatient scripts

Use A4 pdfOptions; preview first. See A4 demo.

Rx labels

Shelf / bottle labels

Custom width/height. See Rx labels demo.

Domestic OS

Kylin/UOS pharmacy PCs

Same npm API as Windows. See Kylin / UOS guides.

Integration steps

  1. Install the desktop client
  2. npm install web-print-pdf
  3. Author HTML/CSS for Rx/labels
  4. Call printHtml or batchPrint with printOptions.printerName
  5. Use preview while tuning layout

A4 prescription parameters

await webPrintPdf.printHtml(
  prescriptionHtml,
  { paperFormat: 'A4', printBackground: true, margin: { top: '10mm', bottom: '10mm' } },
  { printerName: '办公室激光', copies: 1 }
);

Parameter tips

  • Paper: A4 or custom label size in pdfOptions
  • Printer: match client printer list
  • Batch: batchPrint at peak—see print options
  • Errors: formatPrintError—see error handling

Selection notes

  • Manual dialog OK → window.print / Print.js
  • Silent named printer → web-print-pdf + client
  • Server PDF archive → Puppeteer; desk output still uses client

Troubleshooting

  • Clipped content → match pdfOptions to printer paper
  • Connection failed → WebSocket troubleshooting
  • Extra blank pages → zero HTML margins

Related guides on this site

FAQ

Silent print without browser dialog?

Yes—with web-print-pdf and the local client.

Same code for A4 and labels?

Yes—change pdfOptions paper size and HTML template.

Domestic OS support?

Yes—Kylin/UOS deb clients share the same API.

Peak batch dispensing?

Use batchPrint; per-task options override batch defaults.

vs Lodop overlay printing?

Lodop for legacy overlays; HTML Rx can PoC web-print-pdf in parallel.

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