IECapt生成网页快照IECapt.exe下载 CutyCapt

来源:互联网 发布:淘宝服装ps教程 编辑:程序博客网 时间:2024/06/06 09:22

IECapt生成网页快照帮助如下:

C:\>IECapt.exe help
 -----------------------------------------------------------------------------
 Usage: IECapt --url=http://www.example.org/ --out=localfile.png
 -----------------------------------------------------------------------------
  --help                      Print this help page and exit
  --url=<url>                 The URL to capture (http:...|file:...|...)
  --out=<path>                The target file (.png|bmp|jpeg|emf|...)
  --min-width=<int>           Minimal width for the image (default: 800)
  --max-wait=<ms>             Don't wait more than (default: 90000, inf: 0)
  --delay=<ms>                Wait after loading (e.g. for Flash; default: 0)
  --silent                    Whether to surpress some dialogs

 ----------------------------------------------------------------------------


CutyCapt下载地址:http://sourceforge.net/projects/cutycapt/files/cutycapt/

windows CutyCapt不需要安装,直接保存到你的电脑中即可。

然后你php代码如下写

 代码如下复制代码

<?php
/* 
网页截图功能,必须安装IE+CutyCapt
url:要截图的网页
out:图片保存路径
path:CutyCapt路径
cmd:CutyCapt执行命令
比如:http://你php路径.php?url=http://www.php100.com
*/
$url=$_GET["url"];
$imgname=str_replace('http://','',$url);
$imgname=str_replace('https://','',$imgname);
$imgname=str_replace('.','-',$imgname);
$out = 'D:/webroot/test/'.$imgname.'.png';
$path = 'D:/webserver/CutyCapt.exe';
$cmd = "$path --url=$url --out=$out";
echo $cmd;
system($cmd);
?>

如果你是linux系统就需要简单的配置一下CutyCapt



0 0