HTMLtoIMAGE_v100

hh hh at hyperhh.de
Mon Dec 17 11:19:38 EST 2018


HTMLtoIMAGE
makes an image of the *whole* HTML content of a browser widget
(while waiting for printToPdf from the browser widget in 9.x).
The image may have a height of several thousands pixels.

Download from "Sample Stacks" or
http://livecodeshare.runrev.com/stack/919/

The stack is based on the library from
https://html2canvas.hertzen.com (MIT licensed).

This javaScript library takes "screenshots" of webpages based on
the DOM, and as such may not be 100% accurate to the real
representation as it does not make an actual screenshot, but
builds the screenshot based on the information available on the
page.
Then it saves the data to a canvas. [(With movies) "Overlayed"
pages as livecode.com are only partially saved, just try.]

We don't display this HTML5-canvas in a browser but catch with
a javascriptHandler the imagedata and save it to a local image.
You can set options:
• the image format: JPEG with quality level or PNG,
• an image scale (percentage).

The javaScript library is included in the stack (please watch
its license).



More information about the use-livecode mailing list