i have a div with id="div1" , i need to convert it into pdf .so i tried to do with JSPf in angular 2.JSpdf is working good , when i tried to do doc.autoTable(col, rows);.but when i want export it do pdf its not working
<div class="container" id="div1">
<table>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
</table>
<button id="create" (click)="convert()">Create file</button>
</div>
convert(){
const elementToPrint = document.getElementById('div1');
console.log('eelementToPrint',elementToPrint); //The html element to become a pdf
const pdf = new jsPDF('p', 'pt', 'a4');
pdf.addHTML(elementToPrint, () => {
doc.save('web.pdf');
});
}