Decisions

0004 · Print, not a PDF library

A print stylesheet replaces html2pdf.js.

Status: Accepted · 2026-11

Context

Version 1 exported PDFs with html2pdf.js, which bundles html2canvas and jsPDF — hundreds of kilobytes of JavaScript that rasterize the DOM into a JPEG inside a PDF. The output was blurry, text wasn't selectable, and the file name contained slashes from the locale date.

Decision

Use the browser's print pipeline. "Print / PDF" calls window.print(); a print stylesheet hides the app chrome (.no-print) and shows a print-only copy of the receipt (.print-only). Every browser offers "Save as PDF" in that dialog.

Consequences

  • Zero JavaScript for export; vector text that can be searched and copied.
  • Layout is controlled by CSS, so the printed receipt matches the on-screen one.
  • No programmatic file name; the browser uses the page title.
Edit this page on GitHub