I am searching for an open source Java library to generate thumbnails for a given URL. I need to bundle this capability, rather than call out to external services, such as Amazon or websnapr.
http://www.webrenderer.com/ was mentioned in this post: Server generated web screenshots, but it is a commercial solution.
I’m hoping for a Java based solution, but may need to look into executing an external process such as khtml2png, or integrating something like html2ps.
Any suggestions?
The first thing that comes to mind is using AWT to capture a screen grab (see code below). You could look at capturing the JEditorPane, the JDIC WebBrowser control or the SWT Browser (via the AWT embedding support). The latter two embed native browsers (IE, Firefox), so introduce dependencies; the JEditorPane HTML support stopped at HTML 3.2. It may be that none of these will work on a headless system.