I am using jsPDF with jspdf-autotable to generate a Right-to-Left (RTL) PDF report in Arabic. Everything works perfectly, but the headers appear as garbled/corrupt text instead of proper Arabic characters.
const handlePDFExportArabic = () => {
const doc = new jsPDF({ orientation: "landscape" });
// ✅ Add Arabic Font
doc.addFileToVFS("Amiri-Regular.ttf", arabicFont);
doc.addFont("Amiri-Regular.ttf", "Amiri", "normal");
doc.setFont("Amiri");
// ✅ Set Right-to-Left (RTL)
doc.setLanguage("ar");
// ✅ Title in Arabic (Centered)
doc.text("