-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

0

1 Answer 1

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) }); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.