URL to PDF API.

The API for converting Web Pages URL 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: 300

Values: 10 .. 1200

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
AcceptLanguage

Optional

String

Set accept language header.

AcceptLanguage
UserAgent

Optional

String

Set custom user agent.

UserAgent
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: 0

Values: 0 .. 30

ConversionDelay
JavaScript

Optional

Bool

Allow web pages to run JavaScript.

Default: True

JavaScript
Zoom

Optional

Double

Set the default zoom level of webpages.

Default: 1

Values: 1.0 .. 50.0

Zoom
Background

Optional

Bool

Print web page background.

Default: True

Background
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
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: a4

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
MarginLeft

Optional

Integer

Set the page left margin in millimeters (mm).

Default: 5

Values: 0 .. 500

MarginLeft
MarginRight

Optional

Integer

Set the page right margin in millimeters (mm).

Default: 5

Values: 0 .. 500

MarginRight
MarginTop

Optional

Integer

Set the page top margin in millimeters (mm).

Default: 10

Values: 0 .. 500

MarginTop
MarginBottom

Optional

Integer

Set the page bottom margin in millimeters (mm).

Default: 10

Values: 0 .. 500

MarginBottom
References Parameters
Parameter Description Value
CoverUrl

Optional

String

Use web page as cover. It will be inserted before the TOC with no headers and footers.

CoverUrl
Outline

Optional

Bool

Show outline in PDF file.

Default: False

Outline
HeaderUrl

Optional

String

Adds a HTML header. This can be either a URL or HTML code. This and others header and footer properties support these smart tags. [page] - Replaced by the number of the pages currently being printed. [frompage] - Replaced by the number of the first page to be printed. [topage] - Replaced by the number of the last page to be printed. [webpage] - Replaced by the URL of the page being printed. [section] - Replaced by the name of the current section. [subsection] - Replaced by the name of the current subsection. [date] - Replaced by the current date in system local format. [time] - Replaced by the current time in system local format. Passed HTML must be enclosed in DOCTYPE, HTML and BODY tags.

HeaderUrl
HeaderTextLeft

Optional

String

Left aligned header text.

HeaderTextLeft
HeaderTextCenter

Optional

String

Center aligned header text.

HeaderTextCenter
HeaderTextRight

Optional

String

Right aligned header text.

HeaderTextRight
HeaderTextFont

Optional

String

Set header font name.

Default: Arial

HeaderTextFont
HeaderTextSize

Optional

Integer

Set header font size.

Default: 12

Values: 4 .. 72

HeaderTextSize
HeaderLine

Optional

Bool

Display line below the header.

Default: False

HeaderLine
HeaderSpacing

Optional

Integer

Spacing between header and content in millimeters (mm).

Default: 0

Values: 0 .. 100

HeaderSpacing
FooterUrl

Optional

String

Adds a HTML footer. This can be either a URI or HTML code.

FooterUrl
FooterTextLeft

Optional

String

Left aligned footer text.

FooterTextLeft
FooterTextCenter

Optional

String

Center aligned footer text.

FooterTextCenter
FooterTextRight

Optional

String

Right aligned footer text.

FooterTextRight
FooterTextFont

Optional

String

Set footer font name.

Default: Arial

FooterTextFont
FooterTextSize

Optional

Integer

Set footer font size.

Default: 12

Values: 4 .. 72

FooterTextSize
FooterLine

Optional

Bool

Display line below the footer.

Default: False

FooterLine
FooterSpacing

Optional

Integer

Spacing between footer and content in millimeters (mm).

Default: 0

Values: 0 .. 100

FooterSpacing
PDF Output Parameters
Parameter Description Value
PdfTitle

Optional

String

Set the title of the generated PDF file. If value is not set a source document title is used instead.

PdfTitle
LowQuality

Optional

Bool

Generates lower quality PDF, makes smaller file size.

Default: False

LowQuality
Grayscale

Optional

Bool

Generates grayscale PDF.

Default: False

Grayscale

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