Search
 
SCRIPT & CODE EXAMPLE
 

HTML

html page to screenshot

...
<script>
    function makeScreenshot() {
        html2canvas(document.getElementById("screenshot"), {scale: 1}).then(canvas => {
            document.body.appendChild(canvas);
        });
    }
</script>
</body>
Comment

html web page screenshot

<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="html2canvas.js"></script>
<script>
function take_screenshot()
{
 html2canvas(document.body, {  
  onrendered: function(canvas)  
  {
    var img = canvas.toDataURL()
    $.post("save_screenshot.php", {data: img}, function (file){
	window.location.href =  "save_screenshot.php?file="+ file
    });
  }
 });
}
</script>
<body>
<div id="wrapper">
<div id="screenshot_div">
  <button type="button" onclick="take_screenshot()">Take Screenshot</button>
</div>
</div>
</body>
</html>
Comment

PREVIOUS NEXT
Code Example
Html :: birthday wishes using html code 
Html :: html unordered list 
Html :: space in html text 
Html :: javascript object reference 
Html :: character for degrees 
Html :: disable an anchor tag 
Html :: div shift right 
Html :: vue if echo class 
Html :: html clickable image 
Html :: angular select ((ngmodel selected)) 
Html :: bootstrap 4 button link 
Html :: how to send sms with a tag in html 
Html :: how to change the color of text in marquee in html 
Html :: html single line comment 
Html :: html space between words 
Html :: svelte bind store to input 
Html :: how to jump line in html 
Html :: blinking text in html using javascript 
Html :: react hooks html imput on change 
Html :: html left quote 
Html :: how to set video size html 
Html :: horizontal form in html bootstrap 
Html :: HTML5 Video tag not working in Safari , iPhone and iPad 
Html :: html2pdf page break option 
Html :: svelte pass arguments to function 
Html :: make flex scroll on overflow horizontal 
Html :: how to make a list in html 
Html :: html table headers 
Html :: html content in rectangle 
Html :: adding color to text in html 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =