How to generate an output file PDF using html2canvas with angular2
I tried to import the file html2canvas typescript and made a declaration like this to use it
This is in addition to above answer, i.e. add @types/html2canvas to dependencies and add import statement in your code.
However, using the above sample code, I am getting error in VisualStudioCode i.e.
'onrendered' does not exist in type 'Html2CanvasOptions'.
To resolve that, I used "then" as below:
html2canvas(document.body).then((canvas) => {
document.body.appendChild(canvas);
});