Home > Backend Development > PHP Tutorial > php在线截图,该如何解决

php在线截图,该如何解决

WBOY
Release: 2016-06-13 13:52:55
Original
1284 people have browsed it

php在线截图
PHP有没什么办法实现网页在线截图? 不考虑第三方插件 因为我想兼容多平台比如LINUX WINDOWS 在往上找到一段DOM的 能截图但感觉不是很爽 大家有知道的不?
DOM代码
$info = parse_url($url);
$pic = empty($name) ? BF_ROOT.'/upload/'.$info['host'].'.jpg' : $name;
$browser = new COM("InternetExplorer.Application") or die("Can't start Internet Explorer");
try {
$handle = $browser->HWND;
$browser->AddressBar = false;
$browser->MenuBar = false;
$browser->ToolBar = false;
$browser->StatusBar = false;
$browser->FullScreen = true;
$browser->Visible = true;
$browser->Silent = true;
$browser->Navigate($url);//你的页面
while ($browser->Busy) {
com_message_pump(4000);
}
} catch (com_exception $e) {
echo $e;
}
$im = imagegrabwindow($handle, 0);
imagepng($im, $pic);
$browser->Quit();

------解决方案--------------------
jquery 截图. js 有啥兼容不兼容的?呵呵
------解决方案--------------------
COM 已然是第三方了
------解决方案--------------------
jquery好像有很多插件可以实现截图的前台效果,配合php对图片处理,就可以实现了,我做过
------解决方案--------------------
楼主用你的com结合坐标截取快照

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template