GrabzIt

Take Website Screenshots with JavaScriptJavaScript

The diagnostics panel can help you debug your code!

Using the GrabzIt JavaScript API is the simplest way of putting image, PDF and table screenshots into your website, requiring just a <script> tag and some GrabzIt magic!

To take a screenshot you pass your required parameters to GrabzIt in the scripts URL and then when the screenshot is ready the image will load in the same location within the page as the script tag.

First...

In order to prevent other people just copying your JavaScript code and stealing all your GrabzIt account resources, you must authorize what domains can use your Application Key.

The Simplest Example

Simply copy the below JavaScript into the location, within the <body> tags were you want the screenshot to appear. You will need to replace the APPLICATION KEY with your Application Key and replace http://www.google.com with the website you want to take a screenshot of.

<script type="text/javascript"
src="http://grabz.it/services/javascript.ashx?key=APPLICATION KEY&url=http://www.google.com">
</script>
Note to avoid errors the URL parameter should always be URL encoded.

Then simply wait a short while and the image will automatically appear at the script tag location, without you needing to reload the page.

Customizing your screenshots

While the key and url parameters are required and therefore always need to be supplied in the JavaScript URL, all the other parameters are optional.

A parameter is added by appending the parameter in the following format to the URL for every optional parameter you require. Where PARAMETER NAME is one of the above parameter names and VALUE is the value you want the parameter to have.

&PARAMETER NAME=VALUE

For instance if you wanted to have a screenshot with a width of 400px and a height of 400px, in a PNG format and wanted to wait 10 seconds before the screenshot was taken you would do the following.

<script type="text/javascript"
src="http://grabz.it/services/javascript.ashx?key=APPLICATION KEY&url=http://www.google.com
&width=400&height=400&format=png&delay=10000">
</script>