View Full Version : Screen Capture

08-10-2007, 07:20 AM
i want to do a screen capture/scrape of a page, resulting in a JPG or PNG that i could save in a dir of my choice. This capture needs to take place a few seconds after the page loads, to allow all JavaScript and Flash elements on page to load.

It would be great if i could also/just target a specific JS or Flash element to grab, instead of the whole page. There has to be some great PHP solutions for this.

Thanks, Cesar

08-10-2007, 07:44 AM
Well, php is a server-side language, meaning that all processing takes place on the server before the page is ever sent to the browser. Therefore, php cannot wait a few seconds after the page has loaded to perform any functions.

08-10-2007, 07:55 AM
there has to be some type of server-side scripts and modules that can render a page server-side.

sitevista.com does it... why cant I?

i have to be able to load a page in the background. possibly load it into cache first. HTML to PDF conversion scripts do it... sorta somewhat.

08-10-2007, 09:59 AM
why don't you make the php script and run an ajax function on a page when it loads that goes to that script and takes a screenshot and saves the image??

08-10-2007, 10:24 AM
screen shot using what program or scripts. PHP has only windows screen capture.

08-10-2007, 11:17 AM
$im = imagegrabscreen();
imagepng($im, "myscreenshot.png");

that works but only in windows and with a special handler, no doubt you can do it in javascript or if you know java it might, but I haven't used java before so i don't know.

have a look at this site, it looks like u need to use javascript and java

08-11-2007, 12:29 PM
I was totally unaware of that function, I asked the same question a few years ago. Have a look at this thread. :)