addHTMl() and fromHTML() is not populating on angular vesion > 8
Same problem here in React
Same problem here in React
Yeah I solve the problem, instead of using addHTML() , you can use directly use html() a callback function.
e.g
`var doc = new jsPDF();
doc.html(document.body, {
callback: function (doc) {
doc.save();
}
});`
addHTML and fromHTML were replaced with html in 2.x. The typings still contain them, but this is a bug we will fix with the next version.
Thanks for pointing to the html function. How can I add the typings for it?
The typings are located at types/index.d.ts. The TypeScript compiler should pick them up automatically, when using node resolving/npm.
Thanks @HackbrettXXX but the typings are wrong. I thought I can get them right myself to reflect the new .html method.
What exactly is wrong with the typings? Note that there are some issues with the margins and positioning currently (e.g. #2924). If you want to correct them a pull request would be very welcome :)
What exactly is wrong with the typings? Note that there are some issues with the margins and positioning currently (e.g. #2924). If you want to correct them a pull request would be very welcome :)
I finally know why I added the margin attribute, but it didn't work. 馃槄So if I want to use the margin attribute, which version should I reduce to?
Most helpful comment
`var doc = new jsPDF();
doc.html(document.body, {
callback: function (doc) {
doc.save();
}
});`