---
title: Convert and Format raw HTML to PDF API
slug: pdf-from-html
url: https://apyverse.com/chisleroff/service/pdf-from-html
provider: Website Intelligence
categories: [File Conversion, Smart Generation]
tags: [html-to-pdf, pdf-generation, document-conversion, report-export, print-layout]
auth: api_key
---

# Convert and Format raw HTML to PDF API

Convert raw HTML into a PDF file with page size, margins, orientation, and background options. Useful for invoices, reports, and print-ready exports.

## Endpoints

| Method | Path | Description | Atoms |
| --- | --- | --- | --- |
| POST | `websiteintelligence/pdf/from-html` | What it does Converts raw HTML into a PDF document. You send the HTML and optional page setup optio… | 100 |

## About

## What it does
HTML to PDF turns raw HTML into a downloadable PDF file. Send your HTML in the `html` field and get back binary PDF output that you can store, email, or stream to users.

Use the optional layout fields to control the document output: `landscape` for page orientation, `page_size` for A4, Letter, Legal, A3, or Tabloid, and `margin_top`, `margin_left`, `margin_right`, and `margin_bottom` for CSS-based page margins. You can also set `print_background` to include background graphics in the rendered PDF.

HTML to PDF is a practical fit for invoice generation, report export, receipts, and any workflow where you already have HTML templates and need a printable document. Because the input is raw HTML, you can render the same content your app shows in the browser and convert it into a file for download or archival use.

It accepts HTML content up to 5,000,000 characters, making it suitable for large pages and generated documents with substantial markup.

## Usage

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyverse.com/chisleroff/service/pdf-from-html
