Vue silent printing
Call printHtml in Vue 3 admin apps for silent print without the browser dialog.
Read guideThis guide covers installing the npm package web-print-pdf, quick start, and API usage. The client handles local HTML-to-PDF and printer drivers; your front-end calls JavaScript APIs.
Scenario-based guides to deploy and integrate web printing alongside the main docs.
Call printHtml in Vue 3 admin apps for silent print without the browser dialog.
Read guideInstall the deb client on Kylin, UOS, and other Linux distros; use web-print-pdf.
Read guideWebSocket or HTTP polling to receive server jobs and print locally.
Read guideAnonymized summaries for reference; actual setups vary by environment.
A provincial agency needed silent fiscal receipts on domestic OS terminals instead of browser print dialogs.
web-print-pdf for one-click silent printA logistics WMS pushes shipping labels to warehouse PCs; printers run without manual clicks.
A manufacturer prints dynamic ERP HTML reports from UnionTech UOS workstations on the shop floor.
printHtml for work orders and QC reportsnpm install web-print-pdf
Minimal print example:
import webPrintPdf from 'web-print-pdf';
const html = '<h1>订单详情</h1><p>客户:张三</p>';
await webPrintPdf.printHtml(html, {
paperFormat: 'A4',
margin: { top: '10mm' }
}, {
printerName: '默认打印机'
});
Print HTML strings. PDF layout is fully controlled by HTML/CSS—ideal for dynamic reports, receipts, and order pages.
Print online HTML page URLs with cookies, headers, timeout, and other options.
Print Base64-encoded HTML content.
Submit multiple print jobs—labels, invoices, and high-volume scenarios.
The client monitors remote server endpoints in real time via WebSocket or HTTP polling and auto-prints incoming messages. Message format matches web-print-pdf—ideal for ERP/WMS server-pushed jobs.
Print online PDF or image files with printer and copy count options.
See the GitHub README for more APIs.
web-print-pdf is a standard npm package—framework agnostic. Import it in Vue 3 or React components and call printHtml on button click for silent front-end printing without window.print.
Read guide:Vue silent printing
// Vue 3 示例
import webPrintPdf from 'web-print-pdf';
async function handlePrint() {
await webPrintPdf.printHtml(document.getElementById('print-area').innerHTML);
}
You must install the Web Print Expert client first. The npm package only provides JavaScript APIs; printing runs on the local client.
Run npm install web-print-pdf, import it in your component, and call the APIs like any npm library.
In the client under Remote Printing, choose WebSocket or HTTP polling and enter your server URL. Messages must match web-print-pdf format; the client prints automatically on receipt.