I recently added a way to preview what a banner will look like on your website. We do this by using the wonderful thumb.io service that allows you to display real-time screenshots of websites
I've built something like this in the past using PhantomJS. I certainly didn't want to roll my own this time around. I remember it being pretty complex to get right. Thum.io is a great alternative and exactly what I was looking for.