mirror of
https://github.com/kbenestad/invoice.git
synced 2026-06-18 08:04:32 +00:00
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:
parent
8bac41fe77
commit
f39eed979a
2 changed files with 384 additions and 417 deletions
|
|
@ -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
|
||||
|
|
|
|||
725
app/index.html
725
app/index.html
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue