Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set pdf font size for table content using jspdf?

How to set pdf font size for table content using jspdf?

setFontSize doesn't work in my case.

like image 727
Lokesh Das Avatar asked Dec 02 '25 15:12

Lokesh Das


2 Answers

Setting font size for text in a table using jspdf-autotable looks like this:

var doc = new jsPDF();
doc.autoTable({html: '#table', styles: {fontSize: 20}})
doc.save("table.pdf");
like image 160
Simon Bengtsson Avatar answered Dec 05 '25 02:12

Simon Bengtsson


Edit this: jspdf.plugin.autotable.min.js

Find this part and edit fontSize: textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5

the default size is 10 and I change it to 7: textColor:20,halign:"left",valign:"top",fontSize:7,cellPadding:5

like image 31
Elvis Salazar Avatar answered Dec 05 '25 01:12

Elvis Salazar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!