HTM to PNG API.

The API for converting HTML files to PNG images.

Available converters

API Request

Authentication Parameters
Parameter Description Value
Secret

Optional

String

Authentication secret must be provided as a query parameter. If omitted, token must be provided.

Secret
Token

Optional

String

Authentication token must be provided as a query parameter. If omitted, secret must be provided.

Token
Input Parameters
Parameter Description Value
File

Required

File

File to be converted. Value can be URL or file content.

File
Output Parameters
Parameter Description Value
StoreFile

Optional

Bool

Store converted file on our secure server and provides download URL.

Default: False

StoreFile
FileName

Optional

String

Converted output file name without extension. The extension will be added automatically.

FileName
Execution Parameters
Parameter Description Value
Timeout

Optional

Integer

Conversion timeout in seconds.

Default: 120

Values: 10 .. 180

Timeout
Asynchronous Parameters
Parameter Description Value
Async

Optional

Bool

Run conversion job asynchronously.

Default: False

Async
JobId

Optional

String

Conversion job self generated UUID (RFC 4122) used for getting conversion result asynchronously.

JobId
WebHook

Optional

String

Set WebHook URL to call after asynchronous conversion is finished. Async parameter must be enabled.

WebHook
Request Options Parameters
Parameter Description Value
AuthUsername

Optional

String

HTTP authentication username. Could be used if conversion web page is protected with HTTP authentication.

AuthUsername
AuthPassword

Optional

String

HTTP authentication password. Could be used if conversion web page is protected with HTTP authentication.

AuthPassword
Web Page Options Parameters
Parameter Description Value
ConversionDelay

Optional

Integer

Delay in seconds before page load and PDF creation. Sometimes useful to let web page fully load.

Default: 2

Values: 0 .. 30

ConversionDelay
AdBlock

Optional

Bool

Block ads in converting page.

Default: False

AdBlock
JavaScript

Optional

Bool

Allow web pages to run JavaScript.

Default: True

JavaScript
HideElements

Optional

String

Element selector string of the DOM elements that needs to be hidden during conversion.

HideElements
Zoom

Optional

Double

Set the default zoom level of webpages.

Default: 1

Values: 0.1 .. 10.0

Zoom
Image Options Parameters
Parameter Description Value
ImageWidth

Optional

Integer

Image width in pixels.

Values: 10 .. 5000

ImageWidth
ImageHeight

Optional

Integer

Image height in pixels.

Values: 10 .. 5000

ImageHeight
CropX

Optional

Integer

Screenshot crop X offset.

Values: 0 .. 16384

CropX
CropY

Optional

Integer

Screenshot crop Y offset.

Values: 0 .. 16384

CropY
CropWidth

Optional

Integer

Screenshot crop width.

Values: 1 .. 16384

CropWidth
CropHeight

Optional

Integer

Screenshot crop height.

Values: 1 .. 16384

CropHeight

Snippets are autogenerated according to converter parameter choices above. Please select file in "File" or "Files" parameter before using code snippets.

Code snippet is using ConvertAPI PHP Client

Code snippet is using ConvertAPI Java Client

Code snippet is using ConvertAPI C# Client

Code snippet is using ConvertAPI Ruby Client

Code snippet is using ConvertAPI Python Client

Code snippet is using ConvertAPI Go Client

Code snippet is using command line utility program