macOS deployment & integration

Deploy the Web Print Expert client on macOS 11+ (Apple Silicon / Intel) and integrate web-print-pdf for silent web printing and HTML to PDF. APIs match Windows and Linux for a single front-end codebase.

Three client editions

版本平台打印后端安装包
Windows 版Windows 10/11内置静默打印引擎.exe
Linux 版x64 / arm64系统标准打印服务.deb / .rpm
macOS 版macOS 11+(Apple Silicon / Intel)CUPS 打印系统.dmg

Windows, Linux, and macOS ship as separate installers but share the same WebSocket API (/websocket/standard)—front-end web-print-pdf code stays platform-agnostic.

End-user dmg install

  1. Download the macOS dmg from the download page.
  2. Open the dmg and drag Web Print Expert into Applications.
  3. Launch the client, complete setup, and verify the local print service.
  4. npm install web-print-pdf—same APIs as on Windows / Linux.
说明
安装方式Open dmg, drag to Applications
芯片架构Apple Silicon (M-series) and Intel supported
系统版本macOS 11 Big Sur 及以上
启动Launch from Launchpad or Applications folder

First launch & Gatekeeper

macOS may block the app as from an unidentified developer. Try:

  1. Right-click the app in Finder → Open, then confirm.
  2. Or go to System Settings → Privacy & Security and click Open Anyway.
  3. Enterprises can allowlist via MDM to avoid per-machine steps.
No root required for daily use. Keep the app in Applications—do not run directly from the mounted dmg.

Front-end integration (same API as Win/Linux)

Browser pages on macOS use the same npm package and calls as Windows and Linux:

npm install web-print-pdf

Minimal runnable example (client must be running):

import webPrintPdf from 'web-print-pdf';

// 1. 确认本地 WS 服务可用
const status = await webPrintPdf.utils.getConnectStatus();
if (!status.success) {
  throw new Error('请先启动 Web打印专家客户端');
}

// 2. 获取 macOS 上已安装的打印机(CUPS 名称)
const printers = await webPrintPdf.utils.getPrinterList();
const list = printers.data ?? printers;
console.log(list);

// 3. 静默打印 HTML
await webPrintPdf.printHtml(
  '<h1>出库单</h1><p>单号:SO-20260624</p>',
  { paperFormat: 'A4', margin: { top: '10mm', bottom: '10mm' } },
  { printerName: (list[0] && list[0].name) || '默认打印机', copies: 1 }
);

Local service: ws://127.0.0.1:{port}/websocket/standard—port shown in the client UI. web-print-pdf connects automatically; no hard-coded port needed.

macOS print stack

Same pipeline as Windows / Linux; only the output stage differs:

  • Browser calls printHtml → npm submits via local WebSocket
  • Client Chromium engine renders HTML → PDF
  • Job sent via CUPS to printers added in System Settings → Printers & Scanners

If a printer is missing, add it in macOS system settings first, then refresh the list in the client.

Troubleshooting

现象处理建议
npm connection failedEnsure the client is running; check firewall rules for localhost
Missing CJK glyphs in PDFSet common CJK fonts in HTML or install fonts on the Mac
Print does nothingPrint a test page in system settings; verify printerName matches the CUPS queue name
Mixed office environmentShare one web-print-pdf codebase; install the matching client per OS

Deployment notes

  • One front-end codebase across macOS, Windows, and Linux—ideal when design teams use Mac and production runs on Win/Linux.
  • Works offline on intranet; PDF generation is local.
  • Use the built-in Run examples page in the client to debug APIs and printer lists on Mac.
  • macOS clients support updates with the same policy as Windows / Linux.
Download macOS client Documentation