Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Imagegrab through php on locked computer

Posted on 2011-09-29
5
Medium Priority
?
379 Views
Last Modified: 2012-05-12
Hello,

I have the following code for taking screenshots of a website using php. The problem is that I want these screenshots to be taken through a remote computer (a dedicated server) and the image is not taken if I don't have the computer open with the remote desktop. The user is logged in but if the window of the remote desktop is not opened on my computer the screenshot appears black. I tried even to schedule the script to run from the remote computer but that didn't work as well.

Any ideas?

$Browser = new COM('InternetExplorer.Application');
$Browserhandle = $Browser->HWND;
$Browser->Visible = true;
$Browser->Fullscreen = true;
$Browser->Navigate('http://www.mysite.com');
while ($Browser->Busy) {
com_message_pump(8000);
}
$img = imagegrabwindow($Browserhandle, 0);
$Browser->Quit();
imagejpeg($img, 'screenshot.jpg', 100);

Open in new window

0
Comment
Question by:infodigger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 1040 total points
ID: 36813888
You might want to contact these folks and see if they can offer any suggestions.
http://www.shrinktheweb.com/
0
 
LVL 8

Assisted Solution

by:rationalboss
rationalboss earned 960 total points
ID: 36813893
That requires the browser in the dedicated server to be open and to be on focus because it takes a screenshot of what the browser sees.

How about using this instead?
http://de77.com/php/php-class-get-screenshot-thumbnail-of-any-website
0
 
LVL 8

Assisted Solution

by:rationalboss
rationalboss earned 960 total points
ID: 36813899
you may also try thumbalizr.
code here: https://github.com/mptre/thumbalizr (site at thumbalizr.com)

http://www.shrinktheweb.com/ too takes screenshot - they have both free and paid API.

http://www.websnapr.com/ is also very easy to use, it provides screenshot of the site

If you have a linux box, try using wkhtmltoimag.
Details here: http://www.codediesel.com/php/taking-screenshots-of-websites-in-php/

hope this helps :)
0
 

Author Comment

by:infodigger
ID: 36813923
Forgot to mention that the page I want to take screenshots of, has flash also. I tried the wkhtmltoimag solution and some API's for screenshots and didn't work.

Any other way, even command line could work for me if you have anything in mind.

Thank you very much!
0
 

Author Closing Comment

by:infodigger
ID: 36814051
Thank you! I finally found what I was looking for at shrinktheweb.com.
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question