Client must be running?
Yes—use getConnectStatus; see error-handling.
printHtml renders HTML to PDF and prints via the local client—the primary web-print-pdf entry point.
printHtml(html, pdfOptions?, printOptions?, extraOptions?): Promise<PrintResult>| Arg | Stage | Guide |
|---|---|---|
| html | Input string | demos |
| pdfOptions | Layout → PDF | print options |
| printOptions | PDF → printer | print options |
| extraOptions | preview, timeout | print options |
import webPrintPdf from 'web-print-pdf';
await webPrintPdf.printHtml('<p>Hello</p>', {}, { copies: 1 });
Yes—use getConnectStatus; see error-handling.
Configure in pairs—especially paper size.
extraOptions.action = "preview".
Browser/client components only.
ByUrl fetches a URL; printHtml takes HTML string.
The same web-print-pdf front-end runs on Windows, macOS, and Linux/domestic OS—install the matching client on each desktop.