HTML to Image API Docs
  • HTML to Image API
    • Introduction
    • Using the APIs
    • Getting the API token
    • Authorization
    • Generating an Image
    • Screenshot Capture API
    • HTML/CSS to Image API
    • Generate PDF API
    • URL to PDF API
    • HTML/CSS to PDF API
  • Working with Postman
    • How to setup Postman
    • How to import Postman Collection
  • Zapier Integration
    • Gettting Started with the Zapier App
    • Take Daily Website Screenshots with Zapier
    • Convert HTML CSS to Image with Zapier
    • Generate PDF of any Website or Webpage using its URL
    • Generate PDF file from HTML CSS with Zapier
  • Make (Integromat) Integration
    • Gettting Started with the Make (Integromat) App
    • Capture Website Screenshots with Make(Integromat)
    • Convert HTML CSS to Image With Make(Integromat)
    • Generate PDF of any Website using its URL
    • Generate PDF from HTML CSS with Make
  • Contact Us
Powered by GitBook
On this page
  1. HTML to Image API

HTML/CSS to PDF API

Convert HTML/CSS Code into PDF using this flexible API

POST https://api.htmlcsstoimg.com/api/v1/generatePdf

Convert HTML & CSS Code to a PDF

Headers

Name
Type
Description

CLIENT-API-KEY*

String

API Key for your account. Will be available on your dashboard.

Request Body

Name
Type
Description

paperWidth

number

With of the paper of PDF. (optional with paper_size in px),

paperHeight

number

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

String

HTML Content to be used for PDF generation.

css_content

String

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

Boolean

Page orientation where the content is formatted horizontally. By default the page orientation is Portrait.(default : false)

displayHeaderFooter

Boolean

Generated PDF with have header and Footer on each page.(default=false)

printBackground

Boolean

Prints any background colors or images used on the web page to the PDF. Its default value is true.

preferCSSPageSize

Boolean

Get size from CSS styles.(default=True))

PreviousURL to PDF APINextHow to setup Postman

Last updated 1 year ago