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

HTML Render

Render HTML content to PDF, JPG or PNG.

The HTML render API is based on the latest Chromium browser engine and provides excellent rendering quality with full support for HTML5, CSS3, SVG and JavaScript.

Features include:

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-widthnofloatSet the PDF page width explicitly (in mm)
page-heightnofloatSet the PDF page height explicitly (in mm)
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
marginnofloat0The document margin (in mm)
margin-leftnofloat0The document left margin (in mm)
margin-rightnofloat0The document right margin (in mm)
margin-topnofloat0The document top margin (in mm)
margin-bottomnofloat0The 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
cssnostringInject custom CSS into the HTML. e.g. 'body { background-color: red;}'
bg-colornostringFor image rendering set the background color in hexadecimal notation (e.g. #0000ff). For PNG output the special value of 'transparent' can be used to create a transparent PNG
timeoutnointeger300Timeout in seconds. Give up if still trying to load the HTML content after this number of seconds
delaynointeger0Number of seconds to wait before rendering the page (can be useful for pages with animations etc)
ignore-certificate-errorsnobooleanfalseIgnore any TLS/SSL certificate errors
headernostringThe header HTML to insert into each page. The following dynamic tags are supported: {date}, {title}, {url}, {pageNumber}, {totalPages}
footernostringThe footer HTML to insert into each page. The following dynamic tags are supported: {date}, {title}, {url}, {pageNumber}, {totalPages}
API Response
API Performance
Avg Latency1-10s (variable)This API has a non-deterministic latency based on outside factors
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]

API Example
curl https://neutrinoapi.net/html-render \ --header "User-ID: <your-user-id>" \ --header "API-Key: <your-api-key>> \ --data-urlencode "margin=0" \ --data-urlencode "css=" \ --data-urlencode "image-width=1024" \ --data-urlencode "footer=" \ --data-urlencode "format=PDF" \ --data-urlencode "zoom=1" \ --data-urlencode "title=" \ --data-urlencode "content=TEST DOCUMENT Hello, this is a test page..." \ --data-urlencode "page-width=" \ --data-urlencode "timeout=300" \ --data-urlencode "margin-right=0" \ --data-urlencode "grayscale=false" \ --data-urlencode "margin-left=0" \ --data-urlencode "page-size=A4" \ --data-urlencode "delay=0" \ --data-urlencode "ignore-certificate-errors=false" \ --data-urlencode "page-height=" \ --data-urlencode "image-height=" \ --data-urlencode "header={pageNumber} of {totalPages} - {date}" \ --data-urlencode "margin-top=0" \ --data-urlencode "margin-bottom=0" \ --data-urlencode "bg-color=" \ --data-urlencode "landscape=false" \ --output "html-render.pdf"