We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32447ef commit 0dfaa13Copy full SHA for 0dfaa13
src/index.js
@@ -50,12 +50,13 @@ var html2pdf = function(source, opt) {
50
51
// Render the canvas and pass the result to makePDF.
52
var onRendered = opt.html2canvas.onrendered || function() {};
53
- opt.html2canvas.onrendered = function(canvas) {
+ delete opt.html2canvas.onrendered;
54
+ var done = function(canvas) {
55
onRendered(canvas);
56
document.body.removeChild(overlay);
57
html2pdf.makePDF(canvas, pageSize, opt);
- }
58
- html2canvas(container, opt.html2canvas);
+ };
59
+ html2canvas(container, opt.html2canvas).then(done);
60
};
61
62
html2pdf.parseInput = function(source, opt) {
0 commit comments