0

I'm using the SpaceTree plugin from the JIT library. I'm in the final stages of a project and the possibility of using IE6 is a dead end, so as an alternative option, converting the visualisation to an image should be plausible.

I've used canvas's toDataURL() and the new toBlob() functions, but that only produces half of the visusalisation - as the nodes in the SpaceTree contain HTML DOM elements such as DIV, SPAN, IMG and so on for content and styling.

I'm thinking of using PHP's imagecopymerge to superimpose two images. One image being the canvas content (basically the connecting lines between nodes) and the second image being a capture of the HTML page (the content is dynamically loaded with AJAX & JSON).

Does anybody know how I can generate an image of a HTML page that has been dynamically loaded, or has any other suggestions? I can supply more information such as screenshots and a demo probably if need be.

Thanks

dps27a
  • 101
  • 3
  • 11

1 Answers1

0

You can't generate an image of an HTML page.

Actually the functionality does exist. Only in FireFox, and only when offline (ie not on a webpage) using the context's drawWindow method.

Documentation here

There are technically other ways: Look at the entire source and attempt to render an image on your own from what you'd expect it to look like. But that's not easy.

Simon Sarris
  • 62,212
  • 13
  • 141
  • 171