A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2009 yearWebsite screenshots using PHP - page 1
User InfoPosts
Website screenshots using PHP#1
Is there any way of taking a screenshot of a website in PHP, then saving it to a file?

posted date: 2009-04-16 11:25:00


Re: Website screenshots using PHP#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2009-04-16 11:25:01


Re: Website screenshots using PHP#3
Not directly. Software such as Selenium have features like this and can be controlled by PHP but have other dependencys (such as running their java-based server on the computer with the browser you want to screenshot)

posted date: 2009-04-16 11:31:00


Re: Website screenshots using PHP#4
Yes. You will need some things tho:See khtmld(aemon) on *nx.See Url2Jpg for Windows but since it is dotNet app you should also chek Url2BmpBoth are console tools that u can utilise from your web app to get the screenshot.There are also web services that offer it. Check this out for example.Edit:This link is useful to.

posted date: 2009-04-16 11:33:00


Re: Website screenshots using PHP#5
It(s in Python, but going over the documentation and code you can see exactly how this is done. If you can run python, then it(s a ready-made solution for you:http://browsershots.org/Note that everything can run on one machine for one platform, or one machine with virtual machines running the other platforms.Free, open source, scroll to bottom of page for links to documentation, source code, and other information.

posted date: 2009-04-16 11:40:00


Re: Website screenshots using PHP#6
Its a bit overkill I think :)

posted date: 2009-04-16 11:46:00


Re: Website screenshots using PHP#7
LAST EDIT: after 7 years im still getting upvote fot this answer, but I guess this one is now much more accurate.Sure you can, but you(ll need to render the page with something.If you really want to only use php, i suggest you HTMLTOPS, wich render the page and output it in a ps file (ghostscript), then, convert it in a .jpg, .png, .pdf.. can be little slower with complex pages (and dont support all the CSS).Else, you can use wkhtmltopdf to output a html page in pdf, jpg, whaterver..Accept CSS2.0, use the webkit (safari(s wrapper) to render the page.. so should be fine.You have to install it on your server, as well..UPDATE Now, with new HTML5 and JS feature, is also possible to render the page into a canvas object using Javascript. Here a nice library to do that: Html2Canvas and here is an implementation by the same author to get a feedback like G+.Once you have rendered the dom into the canvas, you can then send to the server via ajax and save it as a jpg.EDIT: You can use the imagemagick tool for transforming pdf to png. My version of wkhtmltopdf does not support images. E.g. convert html.pdf -append html.png.EDIT: This small shell script gives a simple / but working usage example on linux with php5-cli and the tools mentioned above. EDIT: i noticed now that the wkhtmltopdf team is working on another project: wkhtmltoimage, that gives you the jpg directly

posted date: 2009-04-16 11:48:00


Re: Website screenshots using PHP#8
Rule 37: There is no overkill. There is only 'open fire', and 'time to reload'.

posted date: 2009-04-16 17:15:00


Re: Website screenshots using PHP#9
+1 for wkhtmltopdf. I've toyed with some other libraries but none of them even came close to supporting anything more than very basic HTML and CSS. wkhtmltopdf can do everything that Safari does, so you're pretty safe there.

posted date: 2009-12-31 03:46:00


Re: Website screenshots using PHP#10
This ought to be good for you:http://code.google.com/p/wkhtmltopdf/Make sure you download the wkhtmltoimage distribution!

posted date: 2010-07-22 00:31:00


Re: Website screenshots using PHP#11
webkit2html works on Mac OS X and Linux, is quite simple to install and to use. See this tutorial.For Windows, you can go with CutyCapt, which has similar functionality.

posted date: 2010-07-30 02:58:00


Re: Website screenshots using PHP#12
Since PHP 5.2.2 it is possible, to capture a website with PHP solely!imagegrabscreen — Captures the whole screen<?php$img = imagegrabscreen();imagepng($img, (screenshot.png();?>imagegrabwindow - Grabs a window or its client area using a windows handle (HWND property in COM instance) <?php$Browser = new COM((InternetExplorer.Application();$Browserhandle = $Browser->HWND;$Browser->Visible = true;$Browser->Fullscreen = true;$Browser->Navigate((http://www.www.momige.com();while($Browser->Busy){ com_message_pump(4000);}$img = imagegrabwindow($Browserhandle, 0);$Browser->Quit();imagepng($img, (screenshot.png();?>Edit: Note, these functions are available on Windows systems ONLY!

posted date: 2010-12-24 06:31:00


select page: « 1 2...»
Copyright ©2008-2017 www.momige.com, all rights reserved.