Key Facts
- Category
- Document Tools
- Input Types
- textarea, file, text, select, checkbox, number
- Output Type
- file
- Sample Coverage
- 4
- API Ready
- Yes
Overview
The HTML to PDF Renderer is a versatile utility designed to convert web content into professional PDF documents using either a deterministic subset renderer for simple layouts or a full browser-based engine for complex styling.
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
Examples
1. Browser-Based Report Generation
Web Developer- Background
- A developer needs to convert a dynamic internal dashboard into a PDF report for management.
- Problem
- The dashboard uses complex CSS and external assets that simple renderers cannot interpret correctly.
- How to Use
- Select 'Browser (Puppeteer)' mode, input the dashboard URL, and set the media type to 'print' for optimal layout.
- Example Config
-
renderMode: browser, mediaType: print, waitUntil: networkidle0 - Outcome
- A perfectly formatted PDF that mirrors the visual layout of the live web dashboard.
2. Simple Document Conversion
Content Writer- Background
- A writer has a clean HTML file containing a technical article and needs to share it as a PDF.
- Problem
- The file is simple and does not require heavy browser rendering, but needs consistent margins and font sizing.
- How to Use
- Upload the HTML file, choose 'Subset (PDFKit)' mode, and configure the margins and font size.
- Example Config
-
renderMode: subset, pageSize: A4, marginTop: 20, marginBottom: 20, fontSize: 12 - Outcome
- A lightweight, clean PDF document generated quickly with consistent document styling.
Try with Samples
xml, html, pdfRelated Hubs
FAQ
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.