Well I needed to use a font which supports unicode characters to generate PDFs from jsPDF in order to serve my purpose. For example the '€' sign since it was generating a gibber when jsPDF inbuild fonts were used as it does not support unicode chars.
However good news is you can use custom true type fonts(ttf) and a lot ttf support unicode chars and my issue above is solved.
Now bad news or the next side effect is after generating the pdf if someone tries to copy the exact text from the pdf and wants to paste it somewhere else like text file, word document etc., generates this:
"ࣆࣆGROODUGROODUORWRIGROODUࣆࣆKDKDLDPULFK"
instead of:
"€€ euro euro lot of euro €€ - haha i am rich ..."
we tried all sorts of workaround with the acrobat pdf settings. Nothing works in particular. Downloaded and tried a lot of different fonts but no solution.
jspdf version is 1.4.1.
Any idea why this is happenening or any solution for this ?
Any help will be so grateful.
Thanks.
Well, the issue was with jspdf version. This problem was solved in 1.5.0 and the version that i was using was 1.4.1
See release notes: https://github.com/MrRio/jsPDF/releases
Move to: commit "c53beb6": Font Dictionary now has toUnicode entry to be able to copy paste out from pdf viewer.