Not able to rendering hindi data properly on pdf using puppeteer in nodejs

Viewed 21

I am generating a PDF using a puppeteer. The language in the PDF I am using is English and Hindi. The problem is the Hindi font is not rending properly in nodejs

      const browser = await puppeteer.launch({
        args: ["--no-sandbox", "--disable-setuid-sandbox", "--headless",'--font-render-hinting=none'],
        ignoreDefaultArgs: ["--disable-extensions"],
        headless: true,
      });
      const page = await browser.newPage();
      await browser.close()
      res.set({
        "Content-Type": "application/pdf;charset=utf-8",
        "Content-Disposition": `inline; filename=${moment().valueOf()}_pdf.pdf`,
      });

Expected Result:-- enter image description here

Getting this Result enter image description here

Does anyone know what's wrong I am doing.?Please let me know if any other information is required. Thanks in advance!!!

0 Answers
Related