问题
Native ancient solution in ColdFusion that used to work with HTML 3.x...
<cfhttp url="#targetUrl#" resolveurl="yes">
<cfdocument format="pdf" name="pdfVar">
#cfhttp.filecontent#
</cfdocument>
<cfpdf action="thumbnail" source="#pdfVar#" pages="1" destination="image">
<cfimage action="writeToBrowser" source="#image#">
Super slow, even with cache, many CSS styles missing or broken.
Any good server-side solution to capture a rendered webpage into a thumbnail? like service provided by http://www.shrinktheweb.com/ ?
Any ColdFusion, Java or Command line utility solution?
回答1:
This website has a script that does what I think your looking for, I haven’t tried using it for any server-side project though.
http://khtml2png.sourceforge.net/
Doesn’t make thumbnails though, but you could render the image created with cfimage.
回答2:
If you have ColdFusion version 8 or better, you can simply use CFDOCUMENT to create a thumbnail.
From Ray's post:
<cfdocument src="http://www.coldfusionjedi.com" name="pdfdata" format="pdf" />
<cfpdf source="pdfdata" pages="1" action="thumbnail" destination="." format="jpg" overwrite="true" resolution="high" scale="25">
回答3:
We ended up using SiteShoter which uses IE as the renderering engine. http://www.nirsoft.net/utils/web_site_screenshot.html
来源:https://stackoverflow.com/questions/7341782/turn-a-web-page-into-an-image-with-coldfusion-java-or-command-line-utility