§ ONLINE API · v2 REFERENCE HTML → PDF · 90 PARAMETERS

HTML to PDF API parameters — every parameter, on one page.

90 parameters. 10 groups. 2 required. The complete REST API surface — every type, default and enum value, in one place. Use the side navigation to jump between groups, or the search box to find a parameter by name.

§ MANDATORY 4 PARAMETERS

Mandatory parameters

Two parameters are non-negotiable. The rest fall back to documented defaults.

PARAMETER
DESCRIPTION
key
REQUIRED string
Your API license key.
url
URL · OR · HTML string
The URL of the web page that is converted to PDF. URL-encoded.
html
URL · OR · HTML string
The raw HTML that is converted to PDF. Pair with base_url to resolve relative paths.
base_url
string
Optional base URL used together with html to resolve relative paths from the HTML string.
§ PAGE SETUP 8 PARAMETERS

Page size, orientation & margins

Customize the size, orientation, and margins of the generated PDF pages.

PARAMETER
DESCRIPTION
page_size
enum default: A4
Specifies the page size of the generated PDF document. If set to Custom, supply page_width and page_height.
Custom A0 A1 A2 A3 A4 A5 A6 A7 A8 Letter HalfLetter Ledger Legal
page_width
number (points)
Custom page width in points (1pt = 1/72 inch). Used only when page_size is Custom.
page_height
number (points)
Custom page height in points (1pt = 1/72 inch). Used only when page_size is Custom.
page_orientation
enum default: Portrait
Page orientation of the generated PDF document.
Portrait Landscape
margin_top
number (points) default: 5
Top margin of the generated PDF document, specified in points.
margin_right
number (points) default: 5
Right margin of the generated PDF document.
margin_bottom
number (points) default: 5
Bottom margin of the generated PDF document.
margin_left
number (points) default: 5
Left margin of the generated PDF document.
§ PAGE NUMBERS 9 PARAMETERS

Page numbers

Auto-generate page numbers in the footer of every page. Format, position, color, and font are all controllable.

PARAMETER
DESCRIPTION
page_numbers
bool default: True
Display the current page number in the footer of each PDF page.
True False
page_numbers_first
int default: 1
Page number for the first rendered page.
page_numbers_offset
int default: 0
Total-pages offset in the generated PDF.
page_numbers_template
string default: "Page: {page_number} of {total_pages}"
The text used to display the page numbers. Supports {page_number} and {total_pages} placeholders.
page_numbers_font_name
string default: Helvetica
Font used to display the page-numbers text.
page_numbers_font_size
number (points) default: 10
Font size of the page-numbers text.
page_numbers_alignment
enum default: 3
Alignment of the page-numbers text.
1 (left) 2 (center) 3 (right)
page_numbers_color
RGB hex default: #333333
Color of the page-numbers text in RGB HTML format.
page_numbers_pos_y
number (points) default: 10
Vertical position (in points) where the page-numbers text is rendered in the footer.
§ PDF OPTIONS 20 PARAMETERS

Document info, security & viewer behavior

Controls how the PDF is identified by metadata, secured, and presented inside a PDF viewer.

PARAMETER
DESCRIPTION
doc_title
string
PDF document title.
doc_subject
string
Subject of the PDF document.
doc_keywords
string
PDF document keywords.
doc_author
string
Name of the PDF document author.
doc_add_creation_date
bool default: False
Save the creation date and time in the PDF document information.
True False
viewer_page_layout
enum default: 1
Page layout used when the document is opened. 0 — Single Page · 1 — One Column · 2 — Two Column Left · 3 — Two Column Right.
0 1 2 3
viewer_page_mode
enum default: 0
Document page mode. 0 — None · 1 — Outlines · 2 — Thumbs · 3 — Full Screen · 4 — OC · 5 — Attachments.
0 1 2 3 4 5
viewer_center_window
bool default: False
Position the document window in the center of the screen.
True False
viewer_display_doc_title
bool default: False
Display the document title in the viewer's title bar.
True False
viewer_fit_window
bool default: False
Resize the document window to fit the size of the first page.
True False
viewer_hide_menu_bar
bool default: False
Hide the PDF viewer application's menu bar.
True False
viewer_hide_toolbar
bool default: False
Hide the PDF viewer application's toolbar.
True False
viewer_hide_window_ui
bool default: False
Hide UI elements (scroll bars, navigation), leaving only the document content.
True False
user_password
string
Password required to view the generated PDF document.
owner_password
string
Password required to view or modify the PDF document.
pdf_name
string default: Document.pdf
Name of the PDF document that will be created.
background_color
RGB hex default: #FFFFFF
Background color of the PDF page in RGB HTML format.
draw_html_background
bool default: True
Render the web-page background in the PDF.
True False
page_breaks_enhanced_algorithm
bool default: False
Use an enhanced custom page-breaks algorithm. Slightly slower but prevents hidden text when custom page breaks are used.
True False
single_page_pdf
bool default: False
Resize the PDF page to fit all the content in a single page.
True False
§ WEB PAGE 19 PARAMETERS

How the web page is loaded

Control the converter's internal browser — viewport, timing, authentication, scripting, links, and rendering engine.

PARAMETER
DESCRIPTION
web_page_width
px default: 1024
Width used by the converter's internal browser window.
web_page_height
px default: 0
Height used by the converter's internal browser. 0 means automatic.
min_load_time
number (seconds) default: 1
Delay before conversion to allow the page to fully load. Increase for pages that take time to render.
max_load_time
number (seconds) default: 30
Maximum time the converter waits for the page to load. Up to 120 seconds.
render_on_timeout
bool default: False
If the page does not finish loading within max_load_time, generate a PDF from the partially loaded content instead of returning an error.
True False
protocol
enum default: 0
TLS/SSL protocol used when fetching the page. 0 means Automatic — the protocol is negotiated with the server.
0 (Automatic)
engine
enum default: WebKit
Rendering engine used for the conversion.
WebKit Restricted Blink Chromium
cookies_string
string
HTTP cookies for the web page being converted, as querystring-encoded name/value pairs.
cookies
object (JSON)
HTTP cookies for the web page being converted, as a JSON object — for JSON requests.
auth_username
string
Username for HTTP Basic authentication on the source page.
auth_password
string
Password for HTTP Basic authentication on the source page.
use_css_print
bool default: False
Use the CSS Print media type instead of Screen.
True False
disable_javascript
bool default: False
Do not run JavaScript in web pages.
True False
disable_internal_links
bool default: False
Do not create internal links in the PDF.
True False
disable_external_links
bool default: False
Do not create external hyperlinks in the PDF.
True False
keep_images_together
bool default: False
Avoid breaking images between PDF pages.
True False
scale_images
bool default: False
Scale images during the conversion process.
True False
startup_mode
enum default: Automatic
Conversion startup mode. Automatic — start as soon as the page loads. Manual — start by calling SelectPdf.startConversion() from within the page.
Automatic Manual
response_content_type
enum default: 0
Response Content-Type. 0 — binary/octet-stream · 1 — application/pdf.
0 1
§ ADVANCED 7 PARAMETERS

Bookmarks, hide elements, partial page, async, raw parameters

Generate automatic bookmarks, exclude specific elements, retrieve the PDF position of HTML elements, convert asynchronously, or pass every parameter as a single JSON blob.

PARAMETER
DESCRIPTION
pdf_bookmarks_selectors
CSS selector
Generate automatic PDF bookmarks. Use a CSS selector — "H1" for all H1, "*.myclass" for all elements with .myclass, "*#myid" for the element with id myid.
pdf_hide_elements
CSS selector
Exclude page elements from the conversion. Same selector syntax as pdf_bookmarks_selectors.
pdf_show_only_element_id
string
Convert only a specific section of the web page. The section is specified by the HTML element ID — image, table, table row, div, text, anything.
pdf_web_elements_selectors
CSS selector
Retrieve the PDF coordinates of HTML elements that match the supplied CSS selectors. Returned in the X-SelectPdf-Web-Elements response header as base64-encoded JSON.
async
bool default: False
Submit the conversion asynchronously. The endpoint returns HTTP 202 with the job ID in the X-SelectPdf-Job-Id header; poll /api2/asyncjob/ to retrieve the PDF.
True False
skip_decoding
bool default: True
Engine-level URL handling toggle. When True, the converter treats the URL as already decoded; set to False if your URL contains characters that must be URL-decoded before fetching.
True False
raw_parameters
string (JSON)
Alternative to multiple form-data fields — pass a JSON object containing all parameter values as a single field. The controller deserializes it into ConvertParameters and then uses the same processing path. Convenient for SDKs and callers that prefer one-shot JSON over many key/value pairs. Silently dropped by the /api2/convert/demo/ endpoint.
§ ASYNC JOB 1 PARAMETER

Asynchronous job polling

Used with GET /api2/asyncjob/ to retrieve a PDF generated by a previous async conversion.

PARAMETER
DESCRIPTION
job_id
string
The job ID returned by an asynchronous conversion submission (in the X-SelectPdf-Job-Id response header).
§ USAGE 1 PARAMETER

Usage tracking

Used with the /api2/usage/ endpoint to read subscription status.

PARAMETER
DESCRIPTION
get_history
bool default: False
Retrieve conversion history for past months alongside the current subscription state.
True False
NEXT

Ready to call the HTML to PDF API?

Read the overview & quickstart, try the no-key watermarked online demo, or grab a 7-day trial key and start with 200 free conversions. Prefer self-hosted? The same engine ships as the .NET PDF library.