Web Print Expert Documentation

This 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.

Topic guides

Scenario-based guides to deploy and integrate web printing alongside the main docs.

Vue silent printing

Call printHtml in Vue 3 admin apps for silent print without the browser dialog.

Read guide

Linux deployment

Install the deb client on Kylin, UOS, and other Linux distros; use web-print-pdf.

Read guide

Remote print setup

WebSocket or HTTP polling to receive server jobs and print locally.

Read guide

Deployment snapshots

Anonymized summaries for reference; actual setups vary by environment.

Government IT

Vue admin on Kylin desktops

A provincial agency needed silent fiscal receipts on domestic OS terminals instead of browser print dialogs.

  • Linux deb client on UOS / Kylin terminals
  • Vue 3 + web-print-pdf for one-click silent print
  • Same HTML templates as Windows—less dual maintenance
Vue silent printing guide
Logistics WMS

Remote label printing

A logistics WMS pushes shipping labels to warehouse PCs; printers run without manual clicks.

  • WebSocket remote print listens to WMS endpoints
  • Message format matches the npm package
  • Stable label output during peak batches
Remote print setup
Manufacturing ERP

UOS shop-floor reports

A manufacturer prints dynamic ERP HTML reports from UnionTech UOS workstations on the shop floor.

  • Linux client on intranet-only PCs
  • printHtml for work orders and QC reports
  • HTML to PDF stays on-device
Linux deployment guide

Quick start

  1. Download and install the Web Print Expert client (Windows or Linux), then launch it
  2. Install the npm package in your front-end project:
npm 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: '默认打印机'
});

API overview

printHtml

Print HTML strings. PDF layout is fully controlled by HTML/CSS—ideal for dynamic reports, receipts, and order pages.

printHtmlByUrl

Print online HTML page URLs with cookies, headers, timeout, and other options.

printHtmlByBase64

Print Base64-encoded HTML content.

batchPrint

Submit multiple print jobs—labels, invoices, and high-volume scenarios.

Remote printing (WebSocket / HTTP)

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.

printPdfByUrl / printImageByUrl

Print online PDF or image files with printer and copy count options.

See the GitHub README for more APIs.

Vue / React integration

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 guideVue silent printing

// Vue 3 示例
import webPrintPdf from 'web-print-pdf';

async function handlePrint() {
  await webPrintPdf.printHtml(document.getElementById('print-area').innerHTML);
}

FAQ

What do I need before using web-print-pdf?

You must install the Web Print Expert client first. The npm package only provides JavaScript APIs; printing runs on the local client.

How do I use it in a Vue project?

Run npm install web-print-pdf, import it in your component, and call the APIs like any npm library.

How do I configure remote printing?

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.

Get started

Download client free View npm package View pricing