I'm new to using jsPDF, am able to generate normal PDF fine, but when am trying to apply external CSS or normal style background color its does not have any effect.
My JSP includes are:
<script src="Javascript/external/jspdf.js"></script>
<script src="Javascript/external/jspdf.plugin.standard_fonts_metrics.js"></script>
<script src="Javascript/external/jspdf.plugin.split_text_to_size.js"></script>
<script src="Javascript/external/jspdf.plugin.from_html.js"></script>
<script src="Javascript/external/jspdf.debug.js"></script>
I am using the script below to generate HTML.
Set Font Size
var doc = new jsPDF();
doc.setFontSize(22);
doc.text(20, 20, 'This is a title');
Set Font Type
doc.setFont("times");
doc.setFontType("italic");
doc.text(20, 40, 'This is times italic.');
Set font Color
doc.setTextColor(255,0,0);
doc.text(20, 40, 'This is red.');
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