IECapt生成網頁快照IECapt.exe下載CutyCapt

大東瓜123發表於2014-07-16

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


相關文章