I am trying to create a pdf file from html using JSPDF and html having one complex table, the added image below.

You can see in this Fiddle that I have tried so far.
pdf.fromHTML(
source,
margins.left,
margins.top, {
'width': margins.width,
'elementHandlers': specialElementHandlers
},
function (dispose) {
pdf.save('Test.pdf');
}, margins);
The problem is that when I try to create a pdf, I get
Uncaught TypeError: Cannot read property 'name' of undefined
Is it possible to use JSPDF for this complex table or will it work only for a simple table.
EDIT:
Decided it differently, This is what I did
- I converted the HTML table to Canvas html2canvas.js
- You can get the canvas as a Base64 image using
canvas.toDataURL("image/jpeg") - Once I received the Base64 image, created an empty PDF file using JSPDF and using the addImage JSPDF function, I managed to embed the Base64 image inside the PDF.
.