PDF generation for developers

Add PDF exports without running Chromium

Build reports, invoices, and downloads with the HTML and CSS you already use. The API manages the browser, rendering, file storage, and delivery.

  • HTML, CSS, and JavaScript
  • Page and print controls
  • Hosted browser rendering

Already have a public webpage? Try URL to PDF.

PDF
Generated with HTML/CSS to Image 1 / 1

Live demo

Try the HTML to PDF API

Edit the HTML and CSS, choose PDF settings, and generate the PDF.

Use cases

Add PDF generation to your application

Read the PDF docs

Application exports

Convert views and report data into downloadable PDFs without maintaining a second rendering system.

Background document jobs

Generate personalized files from queues, scheduled tasks, and data-processing jobs.

Shared web components

Reuse HTML, CSS, web fonts, and charting code across browser views and generated PDFs.

Permanent records

Create PDF records for completed actions, approvals, transactions, and other important events.

Document controls

Control the PDF page, margins, and print styles

Set the document layout in the request instead of maintaining a separate PDF renderer.

Page size

Set exact dimensions

Use custom PDF dimensions in pixels, inches, centimeters, millimeters, or points.

"page_width": "8.5in"
Margins

Set each margin independently

Set the top, right, bottom, and left margins separately.

["0.4in", "0.4in", "0.4in", "0.4in"]
Print styles

Render print CSS and backgrounds

Include CSS background colors and images, and render the page with print media rules.

"print_background": true

One API request

Convert HTML and CSS to PDF

Send HTML, CSS, and PDF options together. The API renders the content in Chromium and returns the generated PDF URL.

  • Chromium rendering

    Render modern HTML, CSS, JavaScript, web fonts, and charts without running a browser.

  • PDF layout controls

    Set page width, height, scale, and all four margins in the request.

  • Page environment

    Choose light or dark mode, timezone, and screen or print media.

  • Timing controls

    Add a delay, set a timeout, or trigger capture with ScreenshotReady().

POST https://hcti.io/v1/image request example.
POST /v1/image
POST https://hcti.io/v1/image
{
"html": "<main>...</main>",
"pdf_options": { "page_width": "8.5in", "page_height": "11in", "margins": [ "0.4in", "0.4in", "0.4in", "0.4in" ], "print_background": true }
}

How it works

From HTML and CSS to downloadable PDF

  1. Send the content

    Send the HTML and CSS that define the PDF content.

  2. Apply PDF settings

    Choose page dimensions, scale, margins, print backgrounds, and browser settings.

  3. Receive the PDF URL

    Download, store, attach, or deliver the generated PDF from the URL in the API response.

Example conversation using the HCTI MCP integration.
Example conversation
MCP connected with OAuth
  1. You: Use the HCTI MCP to turn this HTML report into a letter-size PDF with print backgrounds.
  2. HTML/CSS to Image: I’ll render the HTML and CSS in Chromium, use an 8.5 × 11-inch page, and include CSS background colors and images.
  3. You: Use half-inch margins and return a download URL.
  4. HTML/CSS to Image: The PDF settings now use 0.5-inch margins on every side. I’ll return the hosted PDF URL when rendering finishes.
  5. You: Can the same tool generate a personalized certificate from this markup?
  6. HTML/CSS to Image: Yes. Provide the recipient values with the HTML and CSS, and I’ll generate the finished certificate as a PDF.

MCP integration

Use the HCTI API from your AI tools

Connect an MCP-compatible AI client to HCTI through OAuth.

Generate images and PDFs, capture webpages, and work with templates without putting an API key in the prompt.

PDF generation API

Add PDF generation without running a browser

Convert HTML and CSS to PDF while the API handles Chromium, rendering, storage, and delivery.