I'm trying to export an html(within a div with ID), and have managed to do so with fromHTML(), but unfortunately it doesn't read/use any css I have. This said, I tried with addHTML function, but it looks like nothing happens when I use following code:
function pdfExport(id) {
window.html2canvas = html2canvas;
var dddoc = new jsPDF('p', 'px', 'a4');
var elem_to_export = $("#cmodal-id-" + id)[0];
dddoc.addHTML(document.body, function(){
console.log('saving');
dddoc.save('test.pdf');
});
}
Also, note that I don't get anything printed into console. Not sure if it's worth anything: Before I run this function pdfExport() - (it's ran onclick) - I get one get error in js console, as said image doesn't exist. Now, when I run the function, same error appears again, just as if that image is tried to be loaded again.