In addition to being able to convert URLs GrabzIt's API can also convert HTML to PDF and HTML to images for free. When GrabzIt converts HTML it uses a web browser instance to ensure that any resources, referenced within the HTML are rendered properly. e.g. CSS, JavaScript, videos, Flash, SVG or web fonts.
However any resources not in-lined in the HTML must be referenced using an absolute URL in order to be rendered by GrabzIt. For instance a CSS file should be referenced in the HTML code using http://www.example.com/mystyle.css
rather than mystyle.css
As you can see in the demo above, using the HTML to PDF API or HTML to Image API allows developers to create anything they can imagine. Then have it accurately transformed into an image or PDF by our converter.
GrabzIt can easily enable your app to convert HTML to PDF by using our easy to use API, which is available in nine 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 use our API to convert HTML to PDF using our REST API. Then check out the API documentation for the REST API to find out all the ways you can customize your captures.
curl
-d key=Sign in to view your Application Key
-d format=pdf
-d html=%3Chtml%3E%3Cbody%3E%3Ch1%3EHello%20World%21%3C%2Fh1%3E%3C%2Fbody%3E%3C%2Fhtml%3E
https://api.grabz.it/services/convert.ashx
If you have HTM or HTML files and are using a server-side language such as PHP, then these documents can also be used to generate PDF. Just use the appropriate FileToPDF method for the language you are using instead.
When creating PDF files it is often necessary to specify where you want page breaks to appear in a PDF to stop related content splitting across two pages. To do this you need to specify the special page break HTML syntax as explained in this tutorial.
GrabzIt also enables your application to convert HTML to Images. In one of the following file formats: JPG, PNG, BMP, WEBP or TIFF. Using one of nine 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 to convert HTML to a JPG format using our REST API. Then check out the API documentation for the REST API to find out all the ways you can customize your captures.
curl
-d key=Sign in to view your Application Key
-d format=jpg
-d html=%3Chtml%3E%3Cbody%3E%3Ch1%3EHello%20World%21%3C%2Fh1%3E%3C%2Fbody%3E%3C%2Fhtml%3E
https://api.grabz.it/services/convert.ashx