# HTML to PDF Renderer

Render a limited HTML subset into a PDF with a deterministic layout

> Canonical page: https://elysiatools.com/en/tools/html-to-pdf-renderer

- **Category:** Document Tools

- **Keywords:** html, pdf, render, subset, pdfkit, puppeteer

## Overview

Render HTML into PDF using a deterministic subset renderer.

**Supported tags:**
- p, h1-h6, ul/ol, table, img, code

**Modes:**
- Subset renderer (PDFKit)
- Browser renderer (Puppeteer) for full HTML/CSS

## Inputs

- **HTML Content** (textarea): # Hello PDF
- **HTML File** (file): Upload an HTML file
- **URL** (text): https://example.com
- **Base URL (for relative assets)** (text): https://example.com/docs/
- **Custom CSS (browser mode)** (textarea): /* Optional styles */
- **Render Mode** (select)
- **Page Size** (select)
- **Landscape** (checkbox)
- **Print Background** (checkbox)
- **Scale** (number)
- **Margin Top (mm)** (number)
- **Margin Bottom (mm)** (number)
- **Margin Left (mm)** (number)
- **Margin Right (mm)** (number)
- **Font Size (pt)** (number)
- **Line Height** (number)
- **Media Type (browser mode)** (select)
- **Wait Until (browser mode)** (select)
- **Extra Wait Time (ms)** (number)

## When to use

- Converting simple HTML snippets or documents into standardized PDF files.
- Generating high-fidelity PDFs from complex web pages that require full CSS and JavaScript support.
- Creating printable reports or documentation from raw HTML or existing URLs.

## How it works

- Input your HTML content via text, file upload, or by providing a direct URL.
- Select your preferred render mode: 'Subset' for lightweight PDFKit processing or 'Browser' for full Puppeteer rendering.
- Adjust page settings such as size, orientation, margins, and scaling to match your document requirements.
- Execute the conversion to generate and download your finalized PDF file.

## Use cases

- Generating invoices or receipts from HTML templates.
- Archiving web articles or documentation pages as static PDFs.
- Creating printable versions of internal reports or data dashboards.

## Frequently asked questions

### What is the difference between Subset and Browser modes?

Subset mode uses PDFKit for fast, deterministic rendering of basic HTML tags, while Browser mode uses Puppeteer to render full HTML/CSS as a browser would.

### Which HTML tags are supported in Subset mode?

Subset mode supports standard structural tags including p, h1-h6, ul/ol, table, img, and code.

### Can I apply custom styles to my PDF?

Yes, you can provide custom CSS content when using the Browser render mode to fully control the visual output.

### How do I handle relative assets like images?

You can specify a Base URL in the settings to ensure the renderer correctly resolves relative paths for images and other assets.

### Is it possible to change the page orientation?

Yes, you can toggle the 'Landscape' checkbox in the settings to switch between portrait and landscape orientations.

## Related tools

- [PDF Header/Footer Snippets](https://elysiatools.com/en/tools/pdf-header-footer-snippets): Convert HTML to PDF with reusable logo, title, and date snippets
- [Data URI Generator](https://elysiatools.com/en/tools/data-uri-generator): Convert files into Data URIs (Base64 or percent-encoded) for inlining images, fonts, and assets directly into HTML, CSS, or Markdown
- [HTML Mail to PDF](https://elysiatools.com/en/tools/libreoffice-html-mail-to-pdf): Render email HTML content to PDF with preserved basic formatting using Puppeteer
- [LibreOffice PPT to PDF Handouts](https://elysiatools.com/en/tools/libreoffice-ppt-to-pdf-handouts): Convert PPT/PPTX to PDF and optionally render handout layout with multiple slides per page
- [PDF Invoice Generator](https://elysiatools.com/en/tools/pdf-invoice-generator): Generate a branded invoice PDF from structured line items
- [PDF to HTML](https://elysiatools.com/en/tools/pdf-to-html): Convert PDF documents to HTML web pages with preserved formatting and structure
- [LibreOffice DOCX to PDF](https://elysiatools.com/en/tools/libreoffice-docx-to-pdf): Batch convert .doc/.docx files to PDF via LibreOffice while keeping original layout
- [LibreOffice DOCX to PDF/A](https://elysiatools.com/en/tools/libreoffice-docx-to-pdf-a): Convert DOC/DOCX to PDF/A using LibreOffice rendering and Ghostscript conformance pass

## Samples

- [PDF Samples](https://elysiatools.com/en/samples/pdf-samples): Generated PDF samples from tools dated 2026-02-01 to 2026-02-10
- [Markdown Slide Deck Samples](https://elysiatools.com/en/samples/md-slide-deck-to-pdf): Remark/Marp style Markdown slide decks for testing PDF export layouts
- [Nginx Log Parser Samples](https://elysiatools.com/en/samples/nginx-log-samples): Comprehensive Nginx log samples for testing log-parser tool, including access logs and error logs with various formats and scenarios
- [Android Serialization Java Samples](https://elysiatools.com/en/samples/android-serialization-java): Android Java serialization examples including JSON serialization, deserialization, and XML parsing

## Related content

- [Print-Ready PDF Layout and Publishing Workflow Tools](https://elysiatools.com/en/hubs/print-pdf-layout-workflows): Build print-ready PDFs from HTML, Markdown, or text with layout control, headers, footers, page numbering, TOC generation, and typography tuning in one hub.
- [HTML Content Extraction, Cleanup, and Delivery Tools](https://elysiatools.com/en/hubs/html-content-extraction-cleanup-and-delivery): Extract links, images, tables, and clean text from HTML, then convert or render the result for reuse and delivery.
- [Text Case, Encoding, and Normalization Conversion Tools](https://elysiatools.com/en/hubs/text-convert): Compare text case conversion, character-width conversion, encoding conversion, quoted-printable handling, and inline text normalization tools in one hub.
- [PDF Conversion and Document Export Tools](https://elysiatools.com/en/hubs/pdf-convert): Compare tools that convert documents, images, and structured extractions into or out of PDF in one hub for publishing, sharing, and downstream processing.
