I want to download pdf in Tamil language.
I have problem using Unicode characters. I have tested using basic.html but still no success.
Are you using the latest version of jsPDF?
Yes, version is 1.4.1
Have you tried using jspdf.debug.js?
Yes
Steps to reproduce
demo.zip
What I saw
fifi£fi"flfi"fififl
What I expected
வணக்கம்
Note
I have used this site to convert ttf file to base64 string https://www.giftofspeed.com/base64-encoder/
Ok, there was an issue with ttffont.js where it breaks when in the name table is no postscriptname set.
But the bigger issue is, that your "bamini.ttf" is from 1993 and is as it looks like not Unicode compatible. Font Validator shows me massive errors in the file. All characters of Bamini are in Basic Latin Codespace

So to actually use the font you would have to use the latin letters. So I conclude, that your font is like 25 years old and was used since Windows 3.1 by Tamil Speakers to have atleast some opportunity to write in Tamil language.
If you want to use Unicode Characters, you have to use a real and so to say modern Unicode font. I downloaded MuktaMalar from Google Fonts as an example for a real Unicode font. I used the fontconverter in the folder /fontconverter/ of this project to generate an base64 encoded font with additional code so that to use the font you have just to add the generated javascript-file to the html and you are ready to go.
In the project is my latest experimental build of jspdf.debug.js. You should not use it for the productive environment.
I suppose this issue is solved.
I got the same trouble when trying to show Sinhala. After download a unicode sinhala font, the problem solved. Thank you very much!
hi I tired this code,but not getting correct formet, still is mismatch. please give me some idea
function downloadTamilUnicodeMuktaMalarPdf()
{
const doc = new jsPDF();
doc.setFont('MuktaMalar', 'normal'); // set font
doc.setFontSize(20);
doc.text('தனி மிளகாய் தூள', 20, 20);
doc.save('MuktaMalar.pdf');
}
I also wanted to export that pdf in tamil but not working please give me solution in react js
Most helpful comment
I suppose this issue is solved.