How to use the reactjs?
const pdfConverter = require('jspdf');
Then:
const pdf = new pdfConverter('p', 'mm', 'a4');
pdf.fromHTML(window.document.getElementById('divToPDF'), 10, 10,{'width': 180});
pdf.save('test.pdf');
@matias89 Thank you very much.
@ulongx this issue can be closed
it works fine, but the css style not taking to the pdf, why is that ?
Did you use fromHTML() or html()? ThefromHTML` method is deprecated.
Most helpful comment
const pdfConverter = require('jspdf');
Then:
const pdf = new pdfConverter('p', 'mm', 'a4');
pdf.fromHTML(window.document.getElementById('divToPDF'), 10, 10,{'width': 180});
pdf.save('test.pdf');