Skip to content

Commit 57120de

Browse files
authored
Fix not rendering multiple calls to html() (#3271)
1 parent cda5694 commit 57120de

21 files changed

+13
-2
lines changed

src/modules/html.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,9 +494,12 @@ import { globalObject } from "../libs/globalObject.js";
494494
)
495495
: options.windowHeight;
496496

497+
pdf.context2d.save(true);
497498
return html2canvas(this.prop.container, options);
498499
})
499500
.then(function toContext2d_post(canvas) {
501+
this.opt.jsPDF.context2d.restore(true);
502+
500503
// Handle old-fashioned 'onrendered' argument.
501504
var onRendered = this.opt.html2canvas.onrendered || function() {};
502505
onRendered(canvas);

test/reference/html-basic.pdf

36 Bytes
Binary file not shown.

test/reference/html-font-faces.pdf

38 Bytes
Binary file not shown.
35 Bytes
Binary file not shown.
42 Bytes
Binary file not shown.
42 Bytes
Binary file not shown.
38 Bytes
Binary file not shown.
34 Bytes
Binary file not shown.

test/reference/html-margin-x-y.pdf

34 Bytes
Binary file not shown.

test/reference/html-margin.pdf

34 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)