最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Arabic Headers in jsPDF AutoTable Appear as Garbled or Corrupt Text - Stack Overflow

programmeradmin2浏览0评论

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("
发布评论

评论列表(0)

  1. 暂无评论