GrabzIt
Tools to Capture and Convert the Web

GrabzIt's HTML to PDF and Image APIHTML to PDF and Image API

In addition to being able to convert URL's GrabzIt's API can also convert HTML to PDF's and images. When the HTML is converted it uses a browser instance to ensure that any resources such as CSS, JavaScript, videos, Flash, SVG or web fonts contained within the HTML is rendered properly.

However to ensure this happens any resources that references a URL on another server must reference the resource using an absolute URL otherwise, the resource won't be able to render. For instance you should use http://www.example.com/mystyle.css rather than mystyle.css

HTML


to PDF

As you can see in the demo above, using the HTML to PDF or Image API allows developers to create any thing they can imagine and then have it accurately transformed into an image or PDF by our converter.

HTML to PDF API

GrabzIt can easily enable your app to convert HTML to a PDF by using our easy to use API, which is available in eight different programming languages. Just choose your required programming language below and then follow the relevant instructions.

The example code below shows how easy it is to convert HTML to PDF using C#, although GrabzIt's ASP.NET library is compatible with any .NET language. To start creating PDF's just download the ASP.NET Library, get your Application Key and Secret and then use the demo contained within. Then check out the API documentation for ASP.NET to find out all the ways you can use GrabzIt's API.

GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
grabzIt.HTMLToPDF("<html><body><h1>Hello World!</h1></body></html>"); 
grabzIt.SaveTo("documents/result.pdf");

The example code below shows how easy it is to convert HTML to a PDF using Java. To start creating PDF's just download the Java Library, get your Application Key and Secret and then use the demo contained within. Then check out the API documentation for Java to find out all the ways you can use GrabzIt's API.

GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
grabzIt.HTMLToPDF("<html><body><h1>Hello World!</h1></body></html>"); 
grabzIt.SaveTo("documents/result.pdf");

The example code below shows how easy it is to convert HTML to a PDF using JavaScript. To start creating PDF's download GrabzIt's JavaScript Library. Then get your Application Key and Secret, add the domain you want to use the JavaScript on and then check out the API documentation for JavaScript to find out all the ways you can use GrabzIt's API.

<script src="grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").ConvertHTML("<html><body><h1>Hello World!</h1></body></html>",
{"format": "pdf"}).Create();
</script>

The example code below shows how easy it is to convert HTML to a PDF using Node.js. To start creating PDF's just download the Node.js Package, get your Application Key and Secret and then use the demo contained within. Then check out the API documentation for Node.js to find out all the ways you can use GrabzIt's API.

var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");
client.html_to_pdf("<html><body><h1>Hello World!</h1></body></html>");
client.save_to("documents/result.pdf");

The example code below shows how easy it is to convert HTML to a PDF using Perl. To start creating PDF's just download the Perl Library, get your Application Key and Secret and then use the demo contained within. Then check out the API documentation for Perl to find out all the ways you can use GrabzIt's API.

#!/usr/bin/perl

use GrabzItClient;

$grabzIt = GrabzItClient->new("Sign in to view your Application Key", "Sign in to view your Application Secret");
$grabzIt->HTMLToPDF("<html><body><h1>Hello World!</h1></body></html>");
$grabzIt->SaveTo("documents/result.pdf");

The example code below shows how easy it is to convert HTML to a PDF using PHP. To start creating PDF's just download the PHP Library, get your Application Key and Secret and then use the demo contained within. Then check out the API documentation for PHP to find out all the ways you can use GrabzIt's API.

include("GrabzItClient.class.php");

$grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
$grabzIt->HTMLToPDF("<html><body><h1>Hello World!</h1></body></html>"); 
$grabzIt->SaveTo("documents/result.pdf");

The example code below shows how easy it is to convert HTML to a PDF using Python. To start creating PDF's just download the Python Library, get your Application Key and Secret and then use the demo contained within. Then check out the API documentation for Python to find out all the ways you can use GrabzIt's API.

import GrabzItClient

grabzIt = GrabzItClient.GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret")
grabzIt.HTMLToPDF("<html><body><h1>Hello World!</h1></body></html>") 
grabzIt.SaveTo("documents/result.pdf") 

The example code below shows how easy it is to convert HTML to a PDF using Ruby. To start creating PDF's just download the Ruby Gem, get your Application Key and Secret and then use the demo contained within. Then check out the API documentation for Ruby to find out all the ways you can use GrabzIt's API.

require 'grabzit'

grabzItClient = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret")
grabzItClient.html_to_pdf("<html><body><h1>Hello World!</h1></body></html>")	
grabzItClient.save_to("documents/result.pdf") 	

If you have a HTM or HTML files and are using a server side language such as PHP, then this can also be converted to PDF just use the appropriate FileToPDF method for the language you are using instead.

HTML to Image API

GrabzIt also enables your application to convert HTML to JPG, PNG, BMP or TIFF images using one of eight different programming languages. Just choose the programming language you want to use below, and then follow the associated instructions.

The example code below shows how easy it is convert HTML to a JPG image using ASP.NET. To start creating images just download the ASP.NET Library, get your Application Key and Secret and then use the demo contained within. Then check out the API documentation for ASP.NET to find out all the ways you can use GrabzIt's API.

GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
grabzIt.HTMLToImage("<html><body><h1>Hello World!</h1></body></html>"); 
grabzIt.SaveTo("images/result.jpg");

The example code below shows how easy it is to convert HTML to a JPG image using Java. To start creating images just download the Java Library, get your Application Key and Secret and then use the demo contained within. Then check out the API documentation for Java to find out all the ways you can use GrabzIt's API.

GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
grabzIt.HTMLToImage("<html><body><h1>Hello World!</h1></body></html>"); 
grabzIt.SaveTo("images/result.jpg");

The example code below shows how easy it is to convert HTML to a JPG image using JavaScript. To start creating images download GrabzIt's JavaScript Library. Then get your Application Key and Secret, add the domain you want to use the JavaScript on and then check out the API documentation for JavaScript to find out all the ways you can use GrabzIt's API.

<script src="grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").ConvertHTML("<html><body><h1>Hello World!</h1></body></html>").Create();
</script>

The example code below shows how easy it is to convert HTML to a JPG image using Node.js. To start creating images just download the Node.js Package, get your Application Key and Secret and then use the demo contained within. Then check out the API documentation for Node.js to find out all the ways you can use GrabzIt's API.

var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");
client.html_to_image("<html><body><h1>Hello World!</h1></body></html>");
client.save_to("images/result.jpg");

The example code below shows how easy it is to convert HTML to a JPG image using Perl. To start creating images just download the Perl Library, get your Application Key and Secret and then use the demo contained within. Then check out the API documentation for Perl to find out all the ways you can use GrabzIt's API.

#!/usr/bin/perl

use GrabzItClient;

$grabzIt = GrabzItClient->new("Sign in to view your Application Key", "Sign in to view your Application Secret");
$grabzIt->HTMLToImage("<html><body><h1>Hello World!</h1></body></html>");
$grabzIt->SaveTo("images/result.jpg");

The example code below shows how easy it is to convert HTML to a JPG image using PHP. To start creating images just download the PHP Library, get your Application Key and Secret and then use the demo contained within. Then check out the API documentation for PHP to find out all the ways you can use GrabzIt's API.

include("GrabzItClient.class.php");

$grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
$grabzIt->HTMLToImage("<html><body><h1>Hello World!</h1></body></html>"); 
$grabzIt->SaveTo("images/result.jpg");

The example code below shows how easy it is to convert HTML to a JPG image using Python. To start creating images just download the Python Library, get your Application Key and Secret and then use the demo contained within. Then check out the API documentation for Python to find out all the ways you can use GrabzIt's API.

import GrabzItClient

grabzIt = GrabzItClient.GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret")
grabzIt.HTMLToImage("<html><body><h1>Hello World!</h1></body></html>") 
grabzIt.SaveTo("images/result.jpg") 

The example code below shows how easy it is to convert HTML to a JPG image using Ruby. To start creating images just download the Ruby Gem, get your Application Key and Secret and then use the demo contained within. Then check out the API documentation for Ruby to find out all the ways you can use GrabzIt's API.

require 'grabzit'

grabzItClient = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret")
grabzItClient.html_to_image("<html><body><h1>Hello World!</h1></body></html>")	
grabzItClient.save_to("images/result.jpg") 	
Try all our premium features for free with a 7 day free trial. Then from $5.99 a month, unless cancelled.
  • More Captures
  • More Features
  • More API's
  • Bigger Scrapes
  • Bigger Screenshots
  • Bigger Everything
Start Free Trial