Search code examples
jspdf

Problems printing € symbol with jspdf


I am tryng to print in my PDF document an Euro/Dollar/Pound Symbol with jsPdf,

i have a really simple piece of code like...

var doc = new jsPDF();
doc.text(10,10,'€');

And the result is just a rare words as you can see in the picture below.

Image

how can i fix it?


Solution

  • They solution that i found, is just import a font that contain the € symbol... I followed the example of this web.

    Link: https://github.com/MrRio/jsPDF

    inside the folder examples/js/basic.js you can see how to import a font.

    remember that you have to pass a base64 code to make it works.