For a project I\'m working on I need to be able to generate a PDF of the page the user is currently on, for which I\'ll use jspdf. Since I have a HTML
Use this way stackblitz example
import {jsPDF} from 'jspdf';
@ViewChild('content', {static: false}) content: ElementRef;
public downloadPDF() {
const doc = new jsPDF();
const specialElementHandlers = {
'#editor': function (element, renderer) {
return true;
}
};
const content = this.content.nativeElement;
doc.fromHTML(content.innerHTML, 15, 15, {
width: 190,
'elementHandlers': specialElementHandlers
});
doc.save('fileName.pdf');
}