Imaging

HTML Render

Render HTML content to PDF, JPG or PNG

post/html-render

Request

  • Base URL
    https://neutrinoapi.net
  • Auth
    API key in header user-id and API key in header api-key

Request body application/x-www-form-urlencoded

contentstring required

The HTML content. This can be either a URL to load from, a file upload (multipart/form-data) or an HTML content string

formatstring

Which format to output, available options are: PDF, PNG, JPG

page-sizestring

Set the document page size, can be one of: A0 - A9, B0 - B10, Comm10E, DLE or Letter

titlestring

The document title

marginnumber double

The document margin (in mm)

margin-leftnumber double

The document left margin (in mm)

margin-rightnumber double

The document right margin (in mm)

margin-topnumber double

The document top margin (in mm)

margin-bottomnumber double

The document bottom margin (in mm)

landscapeboolean

Set the document to landscape orientation

zoomnumber double

Set the zoom factor when rendering the page (2.0 for double size, 0.5 for half size)

grayscaleboolean

Render the final document in grayscale

cssstring

Inject custom CSS into the HTML. e.g. 'body { background-color: red;}'

image-widthinteger

If rendering to an image format (PNG or JPG) use this image width (in pixels)

image-heightinteger

If 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

delayinteger

Number of seconds to wait before rendering the page (can be useful for pages with animations etc)

page-widthnumber double

Set the PDF page width explicitly (in mm)

page-heightnumber double

Set the PDF page height explicitly (in mm)

timeoutinteger

Timeout in seconds. Give up if still trying to load the HTML content after this number of seconds

ignore-certificate-errorsboolean

Ignore any TLS/SSL certificate errors

headerstring

The header HTML to insert into each page. The following dynamic tags are supported: {date}, {title}, {url}, {pageNumber}, {totalPages}

footerstring

The footer HTML to insert into each page. The following dynamic tags are supported: {date}, {title}, {url}, {pageNumber}, {totalPages}

bg-colorstring

For 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

execstring

Execute JavaScript on the website. This parameter accepts JavaScript as either a string containing JavaScript or for sending multiple separate statements a JSON array or POST array can also be used. You can also use the following specially defined user interaction functions: <br> <div> sleep(seconds); Just wait/sleep for the specified number of seconds. <br> click('selector'); Click on the first element matching the given selector. <br> focus('selector'); Focus on the first element matching the given selector. <br> keys('characters'); Send the specified keyboard characters. Use click() or focus() first to send keys to a specific element. <br> enter(); Send the Enter key. <br> tab(); Send the Tab key. <br> </div>

user-agentstring

Override the browsers default user-agent string with this one

Response

OK

string binary required

Changes

No recorded changes to this operation across all 4 revisions of this API.