PhantomJS is doing a great job of capturing web pages into image files for me. I am using a script based on rasterize.js.

However, for certain web elements of a fixed size, I need the resulting image to match the size of the web element.

e.g. I have a page like this:

<html>
<body>
    <div id="wrapper" style="width:600px; height:400px;">
       Content goes here...
    </div>
</body>
</html>

In this example, I need it to produce an image sized at 600x400. Is thre a way to get the viewport size dynamically based on a web element in the page I am rasterizing.

I know this one is not a easy one... Ideas?

Thanks

Edit
Report