Reputation: 29
I want to generate PDF of a html table in an Angular 8 project.
Upvotes: 0
Views: 620
Reputation: 684
In your ts file.
import jsPDF from 'jspdf';
import 'jspdf-autotable';
exportAsPDF()
{
const doc = new jsPDF();
doc.autoTable({html: '#table'});
doc.save(this.templateName+".pdf");
}
I hope this will help.
Upvotes: 2