WEB to PDF API.

The API for converting Web Pages to PDF files.

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
Url

Required

String

URI of a web page to convert. Must start with http:// or https://. If URI has special characters like ? or & they must be encoded.

Url
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
Document Options Parameters
Parameter Description Value
PageRange

Optional

String

Set page range. Example 1-10 or 1,2,5.

Default: 1-100

PageRange
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
LoadLazyContent

Optional

Bool

Load page images that loads only when they are visible.

Default: False

LoadLazyContent
CssMediaType

Optional

Collection

Use CSS media type in conversion process.

Default: screen

Values: screen, print

CssMediaType
ViewportWidth

Optional

Integer

Sets browser viewport width.

Default: 800

Values: 200 .. 4000

ViewportWidth
ViewportHeight

Optional

Integer

Sets browser viewport height.

Default: 1024

Values: 200 .. 4000

ViewportHeight
Background

Optional

Bool

Print web page background.

Default: True

Background
FixedElements

Optional

Collection

Change fixed elements CSS 'position' property to adapt page for conversion.

Default: fixed

Values: fixed, absolute, relative, hide

FixedElements
Zoom

Optional

Double

Set the default zoom level of webpages.

Default: 1

Values: 0.1 .. 2.0

Zoom
Page Options Parameters
Parameter Description Value
PageOrientation

Optional

Collection

PDF page orientation.

Default: portrait

Values: portrait, landscape

PageOrientation
PageSize

Optional

Collection

PDF page size.

Default: letter

Values: a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, letter, legal, ledger

PageSize
PageWidth

Optional

Integer

Custom page width in millimeters (mm). This option override PageSize option.

Values: 10 .. 30000

PageWidth
PageHeight

Optional

Integer

Custom page height in millimeters (mm). This option override PageSize option.

Values: 10 .. 30000

PageHeight
MarginTop

Optional

Integer

Set the page top margin in millimeters (mm).

Default: 10

Values: 0 .. 500

MarginTop
MarginRight

Optional

Integer

Set the page right margin in millimeters (mm).

Default: 10

Values: 0 .. 500

MarginRight
MarginBottom

Optional

Integer

Set the page bottom margin in millimeters (mm).

Default: 10

Values: 0 .. 500

MarginBottom
MarginLeft

Optional

Integer

Set the page left margin in millimeters (mm).

Default: 10

Values: 0 .. 500

MarginLeft
Header

Optional

String

Adds a HTML header to every page. HTML tags with the classes 'pageNumber', 'totalPages', 'title', 'date' will be injected with the page metadata. Use inline CSS to style provided HTML.

Header
Footer

Optional

String

Adds a HTML footer to every page. HTML tags with the classes 'pageNumber', 'totalPages', 'title', 'date' will be injected with the page metadata. Use inline CSS to style provided HTML.

Footer

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