HTM to PDF API
The API for converting HTML files to PDF files.
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
String
Element selector string of the DOM element. Converter will wait for this element to appear in DOM before conversion begins.
String
Element selector string of the DOM elements that needs to be hidden during conversion.
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
Collection
Change fixed elements CSS 'position' property to adapt page for conversion.
Default: fixed
Values: fixed, absolute, relative, hide
Show all
String
Element selector string of the DOM elements that should be visible during conversion. Other elements will be hidden.
Bool
If true, the converter will generate PDF as the content looks like in the browser. If is set to false, the converter acts like Chrome print to PDF function.
Default: True
Show all
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
Integer
Custom page width in millimeters (mm). This option override PageSize option.
Range: 10 .. 30000
Show all
Integer
Custom page height in millimeters (mm). This option override PageSize option.
Range: 10 .. 30000
Show all
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.
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.
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