Use get(0)
instead of html()
. In other words, replace
doc.fromHTML($('#htmlTableId').html(), 15, 15, {
'width': 170,'elementHandlers': specialElementHandlers
});
with
doc.fromHTML($('#htmlTableId').get(0), 15, 15, {
'width': 170,'elementHandlers': specialElementHandlers
});