HTML to PDF API for Developers

    Feature

    HTML to PDF API built for teams that need reliable document automation at scale. Convert and process files with simple REST requests, predictable output quality, and production-grade uptime. Use it for invoices, reports, and contracts. Includes clear docs, SDK-ready endpoints, and quick testing in your browser.

    What it does

    Turn templates into PDFs reliably

    Send your HTML and optional CSS, and receive either a downloadable PDF file or a hosted URL (depending on output format).

    Common use cases
    • Invoices / receipts
    • Monthly statements
    • Reports & summaries
    • Certificates
    Why devs like it
    • Fast iteration with HTML
    • Consistent layout across runs
    • Easy branding via CSS
    • Simple REST integration

    Parameters

    What you can send in the request body

    html_content
    required

    The HTML markup to render.

    css_content
    optional

    Extra CSS to apply.

    paper_size
    optional

    A0–A6, Letter, Legal, Tabloid, Ledger. Default A4.

    landscape
    optional

    Boolean. Landscape orientation.

    print_background
    optional

    Include CSS backgrounds. Default true.

    margin
    optional

    Preset: none, small, medium, large. Or object with top/right/bottom/left.

    viewPortWidth / viewPortHeight
    optional

    Viewport size (default 1080×720).

    font
    optional

    Google Font names, pipe-separated. e.g. "Inter|Roboto".

    wait_till
    optional

    Extra delay in seconds after page load.

    dynamic_params
    optional

    Object for {{placeholder}} substitution in HTML.

    output_format
    optional

    url (default), file, base64, binary.

    output_filename
    optional

    Custom filename (.pdf appended automatically).

    Prefer a guided playground? Use the full Try Now.

    Sandbox

    Generate a PDF from HTML/CSS

    Result

    PDF preview, response, and cURL command

    Turn templates into production PDFs

    Run the endpoint in playground, validate layout, and deploy with the same request shape.