I'm trying to generate a PDF from a Lightning Page using jsPDF.
When I use the addHTML function in jsPDF I get an error (but only if locker service is enabled). The problem is in the use of html2canvas in jsPDF, I believe in these lines:
var container = containerDocument.createElement("iframe");
...
containerDocument.body.appendChild(container);
...
var documentClone = container.contentWindow.document;
document is undefined on the contentWindow of the container. Are there any ways around this locker service restriction by editing this html2canvas function?
Or are there any libraries that do allow for either converting html to an image or creating a pdf from html?