JSFiddle - React, Tailwind, and code Playground

by vahid_krgr

HTML

<script src="https://github.com/niklasvh/html2canvas/releases/download/0.4.1/html2canvas.js"></script>
<div id="wrapper">
    <span>این کاراکتر ها بهم میریزند</span>
</div>

CSS

#wrapper
{
    width:200px;
    height:200px;
    background-color:#f3f3f3;
    padding:50px;
    margin:50px;
}

JavaScript

$(document).ready(function() {
    html2canvas($("#wrapper"), {
        onrendered: function (canvas) {
            theCanvas = canvas;
            
            document.body.appendChild(canvas);

            canvas.toBlob(function (blob) {
                saveAs(blob, "Dashboard.png");
            });
        }
    });		
});