Jump to content

PHP Screenshots


idire

Recommended Posts

I know this is probably not possible as php is serverside and screenshots need to be taken client side

 

But is there anyway, to have a button on a webpage which takes a screenshot of a section of your site and saves it to a file. I think the answer to this is probably not...

 

If there is no way of doing it, I guess the solution would be GD with the data off the page, but this would mean coding a gd script for every page of the site.

 

example of what I would want screenshotted:

 

http://www.rstracking.com/records.php

 

on that page, but the screenshot would be the table in the middle. The page is dynamic so it cant be a static image

 

Thanks for the help

Link to comment
https://forums.phpfreaks.com/topic/121393-php-screenshots/
Share on other sites

This is a question out of my capabilities, but what I can surely say is that you can't make it only with PHP or even with JavaScript in the client side. It would need a third party application which creates the screenshots on the fly and saves them somewhere you can easily access. You can use PHP's program execution functions (exec(), system(), etc) to run the external application and show the file upon creation. Don't know such an application so I can't help on it.

Link to comment
https://forums.phpfreaks.com/topic/121393-php-screenshots/#findComment-626014
Share on other sites

It is possible to do with PHP.

 

in fact it only requires the GD library and PHP > 5.2.2 ( i believe?)

http://us3.php.net/manual/en/function.imagegrabscreen.php

http://us3.php.net/manual/en/function.imagegrabwindow.php

 

*HOWEVER*

They are windows ONLY functions.

 

On linux I've read of success by using ImageMagick

 

import -window root imagename.png

 

and passing that through system() or exec()

 

But, that would require you to have a GUI running, and be able to interact with any of the browsers that are available on linux.

 

Heres some quick googling on firefox and the shell:

http://xlife.zuavra.net/index.php/45/

http://thedaneshproject.com/posts/shell-script-scripts-to-restart-firefox/

 

I would say its probably possible... but you would need significant system access to accomplish it as well as a server running a full desktop.

Link to comment
https://forums.phpfreaks.com/topic/121393-php-screenshots/#findComment-626151
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.