Skip to content

Commit a1b28b5

Browse files
committed
Set up example for ignoreClearRect
1 parent e524ab3 commit a1b28b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/canvg_context2d/bar_graph_with_text_and_lines.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,10 @@ <h1>Bar Graph With Text And Lines</h1>
664664
var c = pdf.canvas;
665665
c.width = 1000;
666666
c.height = 500;
667+
var ctx = c.getContext('2d');
668+
ctx.ignoreClearRect = true;
669+
ctx.fillStyle = '#ffffff';
670+
ctx.fillRect(0, 0, 1000, 700);
667671

668672
//load a svg snippet in the canvas with id = 'drawingArea'
669673
canvg(c, document.getElementById('svg').outerHTML, {
@@ -678,7 +682,6 @@ <h1>Bar Graph With Text And Lines</h1>
678682
document.getElementById('source').innerText = makePdf().output();
679683
//makePdf().save();
680684
};
681-
682685
</script>
683686

684687
</body>

0 commit comments

Comments
 (0)