Re: HTMLtoIMAGE_v100

2018-12-17 Thread Bob Sneidar via use-livecode
Yeah the whole page is generated by Java. I guess I was expecting too much. 

Bob S


> On Dec 17, 2018, at 10:13 , hh via use-livecode 
>  wrote:
> 
>> Bob S. wrote:
>> I tried this on a copier web portal. It produced a 0 kbyte file with no 
>> image. 
> 
> So the imagedata of the canvas was empty.
> Thus a pdf created from the DOM will also not work with such pages.
> It will have to rely on the print-layout of the portal: Can you print it
> correctly from a desktop browser?
> 
> What we could try is to scroll the widget down in appropriate pieces and make
> ordinary LC-snapshots from it.
> 
> This is from the html2canvas library docs:
> 
> Limitations
> All the images that the script uses need to reside under the same origin for
> it to be able to read them without the assistance of a proxy. Similarly, if
> you have other canvas elements on the page, which have been tainted with
> cross-origin content, they will become dirty and no longer readable by
> html2canvas.
> The script doesn't render plugin content such as Flash or Java applets.
> 
> Portals (and livecode.com) use often WordPress or similar with lots of 
> plugins...
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: HTMLtoIMAGE_v100

2018-12-17 Thread hh via use-livecode
> Bob S. wrote:
> I tried this on a copier web portal. It produced a 0 kbyte file with no 
> image. 

So the imagedata of the canvas was empty.
Thus a pdf created from the DOM will also not work with such pages.
It will have to rely on the print-layout of the portal: Can you print it
correctly from a desktop browser?

What we could try is to scroll the widget down in appropriate pieces and make
ordinary LC-snapshots from it.

This is from the html2canvas library docs:

Limitations
All the images that the script uses need to reside under the same origin for
it to be able to read them without the assistance of a proxy. Similarly, if
you have other canvas elements on the page, which have been tainted with
cross-origin content, they will become dirty and no longer readable by
html2canvas.
The script doesn't render plugin content such as Flash or Java applets.

Portals (and livecode.com) use often WordPress or similar with lots of 
plugins...


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: HTMLtoIMAGE_v100

2018-12-17 Thread Bob Sneidar via use-livecode
I tried this on a copier web portal. It produced a 0kbyte file with no image. 

Bob S


> On Dec 17, 2018, at 08:19 , hh via use-livecode 
>  wrote:
> 
> 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).
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

HTMLtoIMAGE_v100

2018-12-17 Thread hh via use-livecode
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).
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode