fix(invoices): render invoice PDF with html-to-image for correct Persian

html2canvas re-implements text layout and mangled Persian RTL output (joined
words, broken spacing, reordered emails). Switch the rasterizer to html-to-image,
which renders through an SVG foreignObject using the browser's native text
engine, so Persian shaping/spacing/bidi and oklch() colors all come out right.
Peyda is embedded as base64 @font-face via fontEmbedCSS so html-to-image skips
its slow document-wide font scan. Drop the now-unused html2canvas dependency.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
keyhan
2026-06-19 21:08:14 +03:30
parent 1529bf0d46
commit 49f1ab07bd
3 changed files with 116 additions and 77 deletions
+1 -1
View File
@@ -16,7 +16,7 @@
"axios": "^1.17.0",
"clsx": "^2.1.0",
"framer-motion": "^12.40.0",
"html2canvas": "^1.4.1",
"html-to-image": "^1.11.13",
"jspdf": "^4.2.1",
"lenis": "^1.3.23",
"lucide-react": "^1.18.0",