WEB to PDF API

The API for converting Web Pages to PDF files.

API Request:

Copy parameter's URL Secret Secret
Optional

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

Show all

Copy parameter's URL Token Token
Optional

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

Show all

Copy parameter's URL Url URL to convert
Required

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

Show all

Copy parameter's URL StoreFile Store file
Optional

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

Default: False

Show all

Copy parameter's URL FileName File name
Optional

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

Show all

Copy parameter's URL Timeout Timeout
Optional

Integer Conversion timeout in seconds.

Default: 120

Range: 10 .. 1200

Show all

Copy parameter's URL Async Asynchronous
Optional

Bool Run conversion job asynchronously.

Default: False

Show all

Copy parameter's URL JobId Job ID
Optional

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

Show all

Copy parameter's URL WebHook WebHook
Optional

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

Show all

Copy parameter's URL AuthUsername Authentication username
Optional

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

Show all

Copy parameter's URL AuthPassword Authentication password
Optional

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

Show all

Copy parameter's URL PageRange Page Range
Optional

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

Default: 1-100

Show all

Copy parameter's URL ConversionDelay Conversion delay
Optional

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

Default: 0

Range: 0 .. 30

Show all

Copy parameter's URL AdBlock Ad block
Optional

Bool Block ads in converting page.

Default: False

Show all

Copy parameter's URL CookieConsentBlock Remove cookie warnings
Optional

Bool Tries to remove EU regulation required cookie warnings from web pages.

Default: False

Show all

Copy parameter's URL JavaScript Enable JavaScript
Optional

Bool Allow web pages to run JavaScript.

Default: True

Show all

Copy parameter's URL WaitElement Wait for DOM element
Optional

String Element selector string of the DOM element. Converter will wait for this element to appear in DOM before conversion begins.

Show all

Copy parameter's URL UserJs Execute JavaScript
Optional

String Execute provided JavaScript before conversion begins.

Show all

Copy parameter's URL HideElements Hide DOM elements
Optional

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

Show all

Copy parameter's URL CssMediaType CSS media type
Optional

String Use CSS media type in conversion process. The default screen and print media types are supported but not limited to these. The custom media type, like convertapi can be used too.

Default: screen

Show all

Copy parameter's URL LoadLazyContent Load lazy content
Optional

Bool Load page images that loads only when they are visible.

Default: False

Show all

Copy parameter's URL ViewportWidth Viewport width
Optional

Integer Sets browser viewport width.

Default: 1366

Range: 200 .. 4000

Show all

Copy parameter's URL ViewportHeight Viewport height
Optional

Integer Sets browser viewport height.

Default: 1024

Range: 200 .. 4000

Show all

Copy parameter's URL Background Background
Optional

Bool Convert web page background.

Default: True

Show all

Copy parameter's URL FixedElements Fixed elements
Optional

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

Default: fixed

Values: fixed, absolute, relative, hide

Show all

Copy parameter's URL Zoom Zoom
Optional

Double Set the default zoom level of webpages.

Default: 1

Range: 0.1 .. 2.0

Show all

Copy parameter's URL ShowElements Show DOM elements
Optional

String Element selector string of the DOM elements that should be visible during conversion. Other elements will be hidden.

Show all

Copy parameter's URL PageOrientation Page orientation
Optional

Collection PDF page orientation.

Default: portrait

Values: portrait, landscape

Show all

Copy parameter's URL PageSize Page size
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

Show all

Copy parameter's URL PageWidth Page width
Optional

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

Range: 10 .. 30000

Show all

Copy parameter's URL PageHeight Page height
Optional

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

Range: 10 .. 30000

Show all

Copy parameter's URL MarginTop Margin top
Optional

Integer Set the page top margin in millimeters (mm).

Default: 10

Range: 0 .. 500

Show all

Copy parameter's URL MarginRight Margin right
Optional

Integer Set the page right margin in millimeters (mm).

Default: 10

Range: 0 .. 500

Show all

Copy parameter's URL MarginBottom Margin bottom
Optional

Integer Set the page bottom margin in millimeters (mm).

Default: 10

Range: 0 .. 500

Show all

Copy parameter's URL MarginLeft Margin left
Optional

Integer Set the page left margin in millimeters (mm).

Default: 10

Range: 0 .. 500

Show all

Copy parameter's URL Header Header HTML
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.

Show all

Copy parameter's URL Footer Footer HTML
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.

Show all

Developer mode

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 JavaScript Client

Code snippet is using ConvertAPI Node.js Client

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

For conversions with the multiple file result please refer to the example