Summary
Arabic text renders correctly in the browser Print Preview and when using Chrome's "Save as PDF", but renders differently when using ERPNext/Frappe's "Get PDF" functionality (wkhtmltopdf).
Environment
- Frappe Cloud
- Print Format Type: Jinja
- PDF Generator: wkhtmltopdf
- Arabic + English bilingual quotation/proposal
Expected Behavior
Arabic text should render identically in:
- Browser Print Preview
- Chrome Save as PDF
- ERPNext Get PDF
Actual Behavior
- Browser Print Preview: Arabic renders correctly.
- Chrome Save as PDF: Arabic renders correctly.
- Get PDF (wkhtmltopdf): Arabic characters, ligatures, and RTL text render differently.
Examples observed:
- Arabic labels appear differently in Get PDF.
- Some Arabic words containing "الإ" / "الأ" render inconsistently.
- RTL text positioning differs between browser rendering and generated PDF.
Additional Observation
The issue does not appear to be related to the print format itself.
The exact same HTML/CSS renders correctly when:
- Using Browser Print Preview
- Using Chrome "Save as PDF"
The rendering difference only appears when using ERPNext's "Get PDF" functionality.
This suggests the issue may be related to wkhtmltopdf font loading, Arabic shaping, RTL rendering, or the PDF engine configuration rather than the template.
What I Have Already Tried
Font Upload
Uploaded Arabic fonts to File Manager:
- NotoSansArabic-Regular.ttf
- NotoSansArabic-Bold.ttf
Font Face Configuration
@font-face {
font-family: 'NotoArabic';
src: url('/files/NotoSansArabic-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'NotoArabic';
src: url('/files/NotoSansArabic-Bold.ttf') format('truetype');
font-weight: 700;
}
Summary
Arabic text renders correctly in the browser Print Preview and when using Chrome's "Save as PDF", but renders differently when using ERPNext/Frappe's "Get PDF" functionality (wkhtmltopdf).
Environment
Expected Behavior
Arabic text should render identically in:
Actual Behavior
Examples observed:
Additional Observation
The issue does not appear to be related to the print format itself.
The exact same HTML/CSS renders correctly when:
The rendering difference only appears when using ERPNext's "Get PDF" functionality.
This suggests the issue may be related to wkhtmltopdf font loading, Arabic shaping, RTL rendering, or the PDF engine configuration rather than the template.
What I Have Already Tried
Font Upload
Uploaded Arabic fonts to File Manager:
Font Face Configuration