HTML 转 PDF
将 HTML 转换为可下载的 PDF。粘贴 HTML 标记或上传 .html 文件,选择页面大小和字体,并在浏览器中完全转换:无需上传,无需注册,无转换限制。
输入
读取为 UTF-8 文本并放入上面的框中。
代码块和内联代码始终以等宽字体呈现。
页面内容周围的空白,以磅为单位(72 pt = 1 英寸)。
输出
使用指南
Turn HTML into a real, shareable PDF — headings, bold/italic text, lists,
tables, blockquotes, code blocks and links all render as proper page layout,
not a screenshot. Paste HTML markup or upload an .html file, pick a page
size and font, and download the result — all in your browser.
How to use it
- Paste your HTML into the box, or drop an .html file to load it there.
- Open Page options to set the page size, orientation, body font (Helvetica or Times), font size and margin.
- Press Convert to PDF, then download
document.pdf.
What renders
- Headings (
<h1>through<h6>), each at a distinct size - Bold, italic and text formatting, including combinations
- Bulleted, numbered and nested lists
- Fenced code (
<pre>/<code>) in a monospace font on a shaded background - Blockquotes, rendered indented and italic
- Tables, with column alignment preserved
- Links (clickable in the PDF) and horizontal rules
A content PDF, not a screenshot
This produces a clean, readable PDF from your HTML's structure — headings, text, lists, tables and links laid out on real pages. It isn't a pixel-perfect visual clone of a styled webpage (custom fonts, background colors, precise CSS positioning and images aren't reproduced); if your goal is an accurate document someone can read, search and print, that's exactly what this gives you, without shipping a screenshot dressed up as a PDF.
Free in your browser, private by default
The PDF is built entirely on your device — your HTML is never uploaded, there's no signup, and no cap on how many files you convert. There's no file-size limit beyond what your browser can hold in memory, and long documents automatically flow across as many pages as they need.
Is there an API?
Yes. The same tool is available as a developer API
(POST /v1/tools/html-to-pdf) for converting HTML from a script or backend
— handy for turning a generated report or email template into a
distributable PDF in CI. Send the HTML as a string; the response carries the
PDF as a data URL. The in-browser tool on this page stays free.
I have a live webpage, not HTML source
Use URL to PDF instead — give it a live URL and it fetches the page's readable content server-side and typesets it into a PDF, no HTML source needed.
I need Markdown instead of HTML as my source
Use Markdown to PDF, which lays out Markdown — including GitHub-Flavored tables, strikethrough and task lists — on the exact same page layout engine.
I need HTML from this PDF's source instead of a download
Use HTML to Markdown to get clean Markdown source from the same HTML instead of a PDF.
在代码中使用
REST API
curl -X POST https://api.iotools.cloud/v1/tool/pdf-converter/html-to-pdf \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"htmlSource": "<h1>Project Report</h1>\n<p>A short summary of th…",
"pageSize": "a4",
"orientation": "portrait",
"font": "helvetica",
"fontSize": "12",
"margin": "40"
}'替换成您账户中的密钥。工具的字段即为请求体——没有额外包装。
让 AI 代理执行
Use the IOTools `pdf-converter__html-to-pdf` tool (HTML to PDF) on this input:
YOUR_INPUT_HERE将此粘贴给任何已连接 IOTools MCP 服务器的代理,再加上您的输入内容。
| 每次调用费用 | 5 积分起 |
|---|