API Basics
Data Tools
Browser Bot
HTML Clean
URL Info
Security and Networking
Legacy APIs

HTML5 Render

Legacy API Notice
This API is now deprecated, you should try the new and improved HTML Render API. We will continue to operate this API into the future for pre-existing users however no more feature updates will be applied.

Render HTML content to PDF, JPG or PNG.

HTML5 render is based on the WebKit browser engine, this provides excellent rendering quality, full support for CSS3 and will even execute JavaScript code! The API operates in two main modes, render to PDF (the default) and render to image (JPG or PNG). When rendering out to an image you set the image dimensions using the "image-width" and "image-height" settings, the page related settings have no effect while in image mode.

If your HTML page uses responsive CSS and has a mobile layout which you would like to render instead, set the "media-queries" option to emulate this. If you need to make minor adjustments to the page you can also pass some custom CSS in the "css" field which will override any CSS on the page. Another method to make rendering adjustments is by putting "@media print" CSS in the original document and setting the "media-print" option too.

End Point

Test API
API Request
contentyesstringThe HTML content. This can be either a URL to load from, a file upload (multipart/form-data) or an HTML content string
formatnostringPDFWhich format to output, available options are: PDF, PNG, JPG
titlenostringThe document title
page-sizenostringA4Set the document page size, can be one of: A0 - A9, B0 - B10, Comm10E, DLE or Letter
page-widthnointegerSet the PDF page width explicitly (in mm)
page-heightnointegerSet the PDF page height explicitly (in mm)
marginnointeger0The document margin (in mm)
margin-leftnointeger0The document left margin (in mm)
margin-rightnointeger0The document right margin (in mm)
margin-topnointeger0The document top margin (in mm)
margin-bottomnointeger0The document bottom margin (in mm)
landscapenobooleanfalseSet the document to landscape orientation
zoomnofloat1Set the zoom factor when rendering the page (2.0 for double size, 0.5 for half size)
grayscalenobooleanfalseRender the final document in grayscale
media-printnobooleanfalseUse @media print CSS styles to render the document
media-queriesnobooleanfalseActivate all @media queries before rendering. This can be useful if you wan't to render the mobile version of a responsive website
formsnobooleanfalseGenerate real (fillable) PDF forms from HTML forms
cssnostringInject custom CSS into the HTML. e.g. 'body { background-color: red;}'
render-delaynointeger0Number of milliseconds to wait before rendering the page (can be useful for pages with animations etc)
image-widthnointeger1024If rendering to an image format (PNG or JPG) use this image width (in pixels)
image-heightnointegerIf rendering to an image format (PNG or JPG) use this image height (in pixels). The default is automatic which dynamically sets the image height based on the content
header-text-leftnostringText to print to the left-hand side header of each page. e.g. 'My header - Page {page_number} of {total_pages}'
header-text-centernostringText to print to the center header of each page
header-text-rightnostringText to print to the right-hand side header of each page
header-sizenointeger9The height of your header (in mm)
header-fontnostringCourierSet the header font. Fonts available: Times, Courier, Helvetica, Arial
header-font-sizenointeger11Set the header font size (in pt)
header-linenobooleanfalseDraw a full page width horizontal line under your header
footer-text-leftnostringText to print to the left-hand side footer of each page. e.g. 'My footer - Page {page_number} of {total_pages}'
footer-text-centernostringText to print to the center header of each page
footer-text-rightnostringText to print to the right-hand side header of each page
footer-sizenointeger9The height of your footer (in mm)
footer-fontnostringCourierSet the footer font. Fonts available: Times, Courier, Helvetica, Arial
footer-font-sizenointeger11Set the footer font size (in pt)
footer-linenobooleanfalseDraw a full page width horizontal line above your footer
API Response
API Performance
Avg Latency20msAverage RTT for requests within the same data center/region
Max Rate6/secondMaximum inbound request rate. Exceeding this will result in request throttling
Max Concurrency25Maximum concurrent/simultaneous requests. Exceeding this will result in error code 06 [TOO MANY CONNECTIONS]