More Thoughts on HTML To Image (Plus Code)
Yesterday I posted a demo of a UDF that I had been working on to convert HTML (via a URL or raw HTML) to an image. The UDF works OK, but to be honest it's not all that great. Let me quickly explain the process (as some had guessed in the comments on that post yesterday).
Essentially I'm tapping into some Java objects that are used internally in CF 8 for the HTML rendering for <cfpresentation> and creating an internal web browser using that API. I then load the remote URL (or HTML string) into that browser and paint the contents into a buffered image. In theory it works. Unfortunately the HTML rendering engine is not all that hot when it comes to CSS support (as you can see in the following screenshots):
My blog:
As I said, not so hot. So I'm releasing the code (under the Apache license) in hopes that it's useful to someone and by some off chance someone has some thoughts on how to improve it (see attachment below). I'm thinking of some other possible solutions, so I haven't completely given up on the idea yet.
PS - don't get me wrong, I do think the component is useful. If you slide it in your application please let me know.



Those ICE products seem to cost a bomb!
My next thought was to dig in and see if anyone has implemented the open source Webkit html rendering engine in Java. That will have to wait though, because for what I'm doing this UDF is working fine (just simple raw HTML to image).
Thanks.