HTML renderer
Generate high-quality PDF documents or images from HTML
️ Request example
️ Request parameters
NameTypeDefaultExampleDescription
html
required
string
<p>Hello world!<p>
HTML content to render
format
pdf
Output format
title
string
My document
Title of the generated PDF document or PNG image
imageWidth
integer
512
256
PNG image width (in pixels)
imageHeight
integer
256
PNG image height (in pixels). In not specified, the height will automatically adapt to the content
pageSize
a4
Default page size of the generated PDF document
pageWidth
string
256
100px
Explicit PDF width (in px, mm, in or cm)
pageHeight
string
256
4.5cm
Explicit PDF height (in px, mm, in or cm)
margin
string
0
1in
PDF page margin (in px, mm, in or cm)
marginLeft
string
0
25mm
PDF left margin (in px, mm, in or cm)
marginRight
string
0
25mm
PDF right margin (in px, mm, in or cm)
marginTop
string
0
4.5cm
PDF top margin (in px, mm, in or cm)
marginBottom
string
0
4.5cm
PDF bottom margin (in px, mm, in or cm)
landscape
boolean
false
PDF document orientation
css
string
body { background-color: yellow; }
Custom CSS style content
header
string
<div style="background:grey; width:100%; height:30px; font-size:20px">Page <span class="pageNumber"></span> of <span class="totalPages"></span></div>
HTML page header content. Use special CSS classes to inject parameters: "date", "pageNumber", "totalPages"
footer
string
<div style="background:grey; width:100%; height:30px; font-size:20px">Page <span class="pageNumber"></span> of <span class="totalPages"></span></div>
HTML page footer content. Use special CSS classes to inject parameters: "date", "pageNumber", "totalPages"
️ Response data
TypeExampleDescription
application/pdf
image/png
Response image example
Generated document (PDF or PNG)