Frage

Is there a way to essentially take a screenshot of a specific section of a webpage when a button is pressed and save the image to my server? For example, when I press the button it saves a "screenshot" with all the content between top:100 top:800 left:200 left:700

War es hilfreich?

Lösung

you can use a javascript library html2canvas that worked great for me in one of my projects. Here is a sample to use.

html2canvas(document.body, {
    onrendered: function(canvas) {
        /* canvas is the actual canvas element,
           to append it to the page call for example
           document.body.appendChild( canvas );
        */
    }
});

A working demo here.

Good Luck with this one.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top