Html – Anyone know of a good algorithm for rendering an HTML table to an image

algorithmhtmlimage-processing

There is a standard two-pass algorithm mentioned in RFC 1942: http://www.ietf.org/rfc/rfc1942.txt however I haven't seen any good real-world implementations. Anyone know of any? I haven't been able to find anything useful in the Mozilla or WebKit code bases, but I am not entirely sure where to look.

I guess this might actually be a deeper problem with having to actually render HTML (the contents of table cells) but just to keep it simple – plaintext HTML table as an image. Even an HTML table rendering algorithm ignoring the "as an image" part…

Best Solution

html table rendering is non-trivial due to the various ways that the sizes of the cells may be specified, tables nested within tables, etc.

if all you want is the image, a simple solution would be the .NET browser control (which is basically the COM component for IE) and a screen-capture function

if you want to get some source to manipulate, the Mozilla source should still be available