I'm using Angular and I wanna convert a table from html into pdf, this is my code in component.ts:
downloadPDF() {
const doc = new jsPDF();
const specialElememtHandlers = {
'#editor'(element, renderer) {
return true;
}
};
doc.fromHTML(this.content.nativeElement.innerHTML, 15, 15, {
width: 190,
elementHandlers: specialElememtHandlers
});
doc.save('test.pdf');
}
and my html code is:
<button (click)="downloadPDF()">Save as PDF</button>
I actually can download a pdf, but it is completely white.