Printer
printHTML(html) — web uses a hidden window + window.print(). Mobile/desktop native targets are reserved for future work.
- Method: printHTML(html)
TSXPrinter
1import { Printer } from "@quan-erp/shared-frontend-core";
2
3export async function printReceipt(html: string) {
4 await Printer.instance.printHTML(`
5 <html>
6 <head><title>Receipt</title></head>
7 <body>${html}</body>
8 </html>
9 `);
10}
11
12// Call from a button click (user gesture helps popup blockers)
13// <button type="button" onClick={() => void printReceipt(markup)}>Print</button>