Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printscreen from virtual browser? 1

Status
Not open for further replies.

ThomasJSmart

Programmer
Sep 16, 2002
634
Was wondering if there is a way to launch a browser on a webserver in a virtual desktop and make a print screen?

my goal is to launch this process from php exec to get back a jpg printscreen of a given web page.



<?PHP

exec('/opt/media/grabimg -url -output /home/account/public_html/images/print1.jpg');

echo '<img src="images/print1.jpg" alt="" />';

?>

I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
You could start, say, Firefox under a VNC X server, and then use something like xwd -display localhost:1 -root | xwdtopnm | pnmtopng > /tmp/test.png to create a screenshot (or use some other simpler X screen grabber)[/b], and then terminate Firefox and the X server again.

There's probably a better way to select the correct window though so that you don't get the window manager arround it... or perhaps make sure that the X session in question is very minimalist, perhaps without running any window manager at all for that user ID.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top