title: Headless HTML rendering to image on CentOS 5.4
body: <p>I have a project requirement to render HTML and capture the rendered image as a file on a headless CentOS 5.4 server.  My specific requirements are:</p>
  
  <p>1) Input will be a URL to the page to render (or file:// URL to a local HTML file), output will be an image file containing the rendered image of the page<br>
   2) CSS must be supported by the renderer up to CSS level-1<br>
   3) Static images in the page must be displayed properly in the rendered image, including any transparent color in .GIF or .PNG files<br>
   4) Must be able to run on a headless CentOS 5.4 server.<br>
   5) Solution must not depend on any product or component that is not free for commercial use  </p>
  
  <p>I do not need to do anything with the page other than get the screen capture and save it to an image.  The hard part seems to be doing this in a headless environment.  Some of the solutions that I've seen discussed need a display in order to work.</p>
  
  <p>Any suggestions?</p>
  
  <p>Thanks in advance,
  Jim</p>
  
  <p>SOLUTION:
  I ended up using the Standard Widget Toolkit library (www.eclipse.org/swt) for its embedded browser capabilities. This allowed me to programmatically open a window with a browser control in it, render the page, then capture the content of the window to an image file (usually a PNG). The only downside to this approach that cannot be avoided is a "flicker" when the window must be made visible for a moment in order to do the screen capture. I can live with it. The rest was just code to initialize the SWT objects that obtain system resources, a listener to check for a successful completion of the page load, and some code to clean up a hung connection (when the page load never completes for whatever reason).</p>
  
  <p>I got a teammate to play around with xvfb (X virtual framebuffer) on CentOS Linux. The initial tests appear to work, so it looks like the advice from the poster below (who said to try xvfb) may be a viable solution for the headless server part of my issue.</p>