I want to take screenshot from webpage using JavaScript and include theme the canvas tag. Previously I tried html2canvas plugin but its not powerful and I want to do this by my self . How I can to this ? Thanks
1 Answer
The library you can use https://html2canvas.hertzen.com/documentation
Call this JavaScript File
<script src="https://html2canvas.hertzen.com/dist/html2canvas.min.js"></script> HTML
<div id="capture" style="padding: 10px; background: #f5da55"> <h4 style="color: #000; ">Hello world!</h4> </div> JavaScript
html2canvas(document.querySelector("#capture")).then(canvas => { document.body.appendChild(canvas) });