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

Calendar

Sun Mon Tue Wed Thu Fri Sat
      1
2 3 4 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       

Subscribe

Enter your email address to subscribe to this blog.

Tags

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

Recent Comments

Editing A Query In A SQL Server DTS Package
JD said: Thanks for your post. Never unlike Microsoft to hide stuff in the hardest part time find. [More]

Mashing Spry Effects With CF8 Ajax Goodness
Mark Pitts said: I have had moderate success implementing Spry Accordian. Sadly the part that does is not working wil... [More]

Chinese Birth Calendar Accuracy Test
Toni Lehman said: This calendar was accurate for both my daughters and 4 grandchildren. I tried it for 11 of my other ... [More]

Virtual Memory - Am I The Last To Know?
Larry Miller said: The authors friend was right. Windows virtual memory system was designed by experts and they fully u... [More]

Using A PlayStation 2 HDD In Your PC
Alacres said: Thanks so much for the guide man! I did have a more specific question though, since I didn't see it ... [More]

RSS


coldfusionbloggers

FullAsAGoog MXNA

Consumed By Feed-Squirrel.com