Can someone help with an example for setting custom fonts for jspdf-autotable
I tried the following
var doc = new jsPDF('p', 'pt');
doc.setFont("rotobo"); ----> font face name that I declared in my css file
doc.autoTable(columns, data);
doc.save("table.pdf");
After I tried this, the fonts in PDF did not change.
Any suggestions would be appreciated.
You can use
console.log(doc.getFontList());
to check what fonts they support. It seems that they only support these fonts:
[Courier] [Helvetica] [Times] [ZapfDingbats] [courier]
If you want to show a check mark in your PDF file, this plug-in may not have the capabilities to do that...
Try something like this.
doc.autoTable(columns, data, {styles: {font: "rotobo"}});
or
You can refer more on Custom style example here and the doc README.md shows all the styles.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With