Convert HTML/CSS Code into PDF using this flexible API
POST https://api.htmlcsstoimg.com/api/v1/generatePdf
POST
https://api.htmlcsstoimg.com/api/v1/generatePdf
Convert HTML & CSS Code to a PDF
CLIENT-API-KEY*
String
API Key for your account. Will be available on your dashboard.
paperWidth
number
With of the paper of PDF. (optional with paper_size in px),
paperHeight
Height of the paper of PDF.(optional with paper_size in px),
paper_size
Size of the paper, Any out of [‘A3’, ‘A4’, ‘A5’, ‘Letter’, ‘Legal’]. (Optional with width and height),
html_content
HTML Content to be used for PDF generation.
css_content
CSS Content to be used for PDF generation
generate_pdf_url
Boolean
Whether the output should return the image or the PDF URL. Default value is true.
landscape
Page orientation where the content is formatted horizontally. By default the page orientation is Portrait.(default : false)
displayHeaderFooter
Generated PDF with have header and Footer on each page.(default=false)
printBackground
Prints any background colors or images used on the web page to the PDF. Its default value is true.
preferCSSPageSize
Get size from CSS styles.(default=True))
Last updated 1 year ago