1

I want to take a screenshot from my website of another website or preferable 1 part of it (an object tag).

I want it to work this way: I click on a button that will send a request to screenshot the page at this moment. Several ideas are insert the page inside a flash object and screenshot it. Or opening a browser on the server and when I click the button send a request using AJAX to tell the server to screenshot with this browser.

How should I do this because I kind of failing right now with the flash Idea. The page I am trying to screenshot is a live camera that uses a .wvx object. But I can't even do that with a .swf object.

Thanks!

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
Vadiklk
  • 3,696
  • 5
  • 28
  • 44
  • Related: http://stackoverflow.com/questions/757675/website-screenshots-using-php – Aziz Feb 11 '12 at 12:36
  • We moved our techblog to Tumblr, here is the new link to the blog post: http://techblog.floorplanner.com/post/20528549445/server-side-png-rendering-of-swf-images-using-gnash – Valentin Jul 06 '12 at 10:02

1 Answers1

1

You can try phantomjs. They have several examples of renderding page output. It supports plugins like flash too.

render() always renders the entire page. To just render one <object> tag, I guess you can do one of:

  • create a page that only contains that <object> tag.
  • use javascript to remove everything else.
  • crop the final screenshot based on <object> page coordinates.

To use phantomjs from php, try php-PhantomjsRunner.

Edit 1: In case you only want to render a flash file that does not actually rely on the web page it is in, you can try Gnash according to the blog post "Server-side PNG rendering of SWF images using Gnash" by Valentine Bichkovsky.

Joel Purra
  • 24,294
  • 8
  • 60
  • 60