-1

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

Mohammad RN
  • 131
  • 10

1 Answers1

0

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)
});
Googlian
  • 6,077
  • 3
  • 38
  • 44