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:

ColdFusionBloggers.org:

Dan Vega's 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.



Comments
Looks cool Todd :) Out of curiosity did you try the ICEbrowser trial version to see if the rendering has improved, or are the components that ship with CF8 fairly up-to-date?

Those ICE products seem to cost a bomb!
# Posted By Justin Carter | 4/6/08 9:52 PM
I did try the trial version - it was crap as well. I can't believe people pay for that...

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).
# Posted By todd sharp | 4/7/08 9:57 AM
Has there been any further work on this, or any luck with finding a webkit html rendering engine in Java? I'm looking to do something like this in CFMX7, but so far haven't been having any luck.

Thanks.
# Posted By Levii Smith | 10/13/08 8:12 AM
I'm a little late in the game, just wanted to throw what I came up with into the mix, it still has some rendering issues with complex (i guess you could call it 'complex')

http://pastebin.com/f2747b874
# Posted By Don Q | 2/1/09 6:54 AM

Calendar

Sun Mon Tue Wed Thu Fri Sat
   1234
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

Subscribe

Enter your email address to subscribe to this blog.

Tags

actionscript ajax blogging cfsnippets coldfusion flash forms flex funny stuff javascript misc model-glue off topic personal project learn slidesix sql

Recent Comments

Adding Auto Generated Code Downloads to BlogCFC
ada5fsa said: http://www.ibiblio.org/st... http://www.ncaonline.org/...... [More]

Chinese Birth Calendar Accuracy Test
mama to be said: ok so i will be 2 months shy of 18 when i have my baby. this calendar does not technically work for ... [More]

Fixing 'User Profile Service Failed The Logon' on Vista
Mike said: That fix worked although all i did was remove .bak and reset state to 0. User was able to log in to... [More]

Chinese Birth Calendar Accuracy Test
Melissa said: Wrong for my daughter, which it predicted to be a boy... we'll see for #2. Predicts a girl (maybe, f... [More]

Adding Auto Generated Code Downloads to BlogCFC
fweerw said: http://www.ibiblio.org/st... http://www.cambodia.ait.a...... [More]

RSS


adobe community experts

coldfusionbloggers

FullAsAGoog MXNA

Consumed By Feed-Squirrel.com