I'm using datatables to export table as excel, pdf. Every thing works fine except this: Export pdf and the table contains non English characters (like Arabic). In this case the pdf show strange characters. So how could I fix Arabic characters problem in pdf export?
3
votes
2 Answers
0
votes
See the pdfmake documentation on the topic of custom fonts. My guess (hard to say without being able to see the page) is that the default pdfmake font doesn't include those characters.
0
votes
We need to add our fonts in vfs_fonts.js and refer to those fonts in JS file.
- create a new vfs_fonts.js file containing your font files
- assign pdfMake.fonts in your javascript
- specify the font in your doc-definition
Refer: https://pdfmake.github.io/docs/0.1/fonts/custom-fonts-client-side/