Replace browser print with jsPDF Helvetica PDF generation

The browser print-to-PDF approach requires the user to manually toggle
"Background graphics" on and "Headers and footers" off — impossible to
control programmatically. Replace with direct jsPDF generation:

- Loads jsPDF 2.5.1 UMD from CDN
- buildPDF() draws the invoice programmatically using Helvetica (PDF
  built-in font, no embedding needed)
- Layout: sender/title header, navy rule, charge-to block with navy
  accent bar, line-items table (navy header, alternating rows, multi-
  line description wrapping, foreign-currency sub-row), totals with
  navy To-Pay bar — all in mm on A4
- PDF downloads directly as invoice-{no}.pdf with no dialog
- HTML preview overlay retained for review before download
- Replace "print-invoice" config key with "download-pdf"

https://claude.ai/code/session_015iyCBgoTXNNqaErR287U1u
This commit is contained in:
Claude 2026-05-19 07:52:40 +00:00
parent 8bac41fe77
commit f39eed979a
No known key found for this signature in database
2 changed files with 384 additions and 417 deletions

View file

@ -389,11 +389,11 @@ translations:
de: "Nein"
fr: "Non"
"no": "Nei"
print-invoice:
en: "Print / Save as PDF"
de: "Drucken / Als PDF speichern"
fr: "Imprimer / Enregistrer en PDF"
"no": "Skriv ut / Lagre som PDF"
download-pdf:
en: "Download PDF"
de: "PDF herunterladen"
fr: "Télécharger PDF"
"no": "Last ned PDF"
close:
en: Close
de: Schließen

File diff suppressed because it is too large Load diff