我尝试在 Windows 7 上使用Snappy
(src - http://www.codediesel.com/downloads/snappy ) 和wkhtmltoimage
(src - http://code.google.com/p/wkhtmltopd ) 从 URL 获取图像,但每次我明白了
错误:图像无法显示,因为它包含错误
代码:
<?php
require_once('Snappy/Media.php');
require_once('Snappy/Image.php');
/* 'wkhtmltoimage' executable is located in the current directory */
$snap = new Image('C://"Program Files"/wkhtmltopdf/wkhtmltopdf.exe');
/* Displays the bbc.com website index page screen-shot in the browser */
header("Content-Type: image/jpeg");
$snap->output('http://www.bbc.com bbc.jpg');
?>