HTML to PDF

HTML to PDF

Convert HTML files to PDF with full styling preserved.

Upload .html files or paste code
CSS styles preserved
Images rendered
Clean PDF output
HTMLHTM

HTML 转 PDF 一览

转换前需要了解的要点。

价格
免费,无水印。 无需注册。免费账户可一次转换 3 个 HTML 文件或链接。
支持格式
HTML 文件、粘贴代码或链接。 上传 .html、.htm 或 .xhtml 文件,粘贴 HTML 代码,或输入网址。
输出
由真实浏览器渲染的 PDF。 支持现代 CSS、网络字体和 JavaScript,页面为 A4、页边距 15 毫米。
限制
未登录:1 个文件,最大 80 MB。 免费账户:一次 3 个文件,单个 80 MB,总计 120 MB。粘贴的代码每次转换一份。
适用于
任意浏览器,免安装。 Windows、Mac、Linux、Chromebook、iPhone 和安卓手机。
隐私
在服务器上渲染,随后删除。 每个页面在隔离的浏览器中加载,文件在一小时内删除。

How to convert HTML to PDF

1
Pick your input mode: paste a URL, upload one or several .html files from your device or cloud (Google Drive, Dropbox, OneDrive), or paste raw HTML code directly.
2
For an uploaded .html file, a code preview of your HTML source appears in the sidebar so you can confirm you picked the right file before converting.
3
Click Convert to PDF. A real Chromium browser renders the page, so fonts, images, CSS styling, JavaScript-rendered content, and links are all preserved in the final document.
4
Download your PDF, save it back to the cloud, or send it straight into another tool like Merge or Sign.

Why use our HTML to PDF converter

Three input modes
Paste a URL, upload one or more .html files, or paste raw HTML code - whichever is closest to your source.
URL to PDF
Drop in any public webpage URL and we render it cleanly, including CSS, images, and web fonts.
.html file upload
Convert local HTML files complete with their styling - useful for offline mockups and exported templates.
Raw HTML paste
Developer-friendly: paste HTML and CSS directly to test markup or generate documents from code snippets.
Real browser (Chromium) rendering
Every mode renders in a real headless Chromium engine, so the PDF matches what a modern browser shows.
Modern CSS & JS
Full flexbox and grid, web fonts, and JavaScript-rendered content all come through - powered by the Chromium engine.
Code preview
Uploading an .html file shows a preview of its source code in the sidebar, so you can confirm the right file before converting.
Batch processing
File uploads and URLs run in batch - up to 3 at once with a free account (80 MB each, 120 MB total). Each becomes its own clean PDF.
Cloud import
Pull .html files from Google Drive, Dropbox, or OneDrive without a local download step.
Workflow chaining
Send the resulting PDF straight into Merge, Compress, Sign, or any other tool without re-uploading.
Free, no watermark
No watermark on the PDF, no signup needed for single jobs, no per-day cap on conversions.

Frequently asked questions

HTML 怎么免费转成 PDF?

在上方上传 .html 文件,或切换到粘贴代码、输入链接,然后转换,即可下载渲染后的 PDF。完全免费,无水印,无需注册。

可以直接粘贴 HTML 代码转 PDF 吗?

可以。选择 HTML 代码模式,粘贴含 style 标签 CSS 的代码后转换,适合自己生成的发票、报表和模板。

支持 CSS、网络字体和 JavaScript 吗?

支持。页面由 Chromium(Chrome 的内核)渲染,flexbox、grid、网络字体和 JavaScript 都与现代浏览器一致;脚本会在截取 PDF 前执行,图表和动态内容都会显示。

为什么 PDF 里的图片不显示?

使用完整 https 地址的网络图片和样式表可以正常加载;但你电脑本地文件夹里的图片等资源,我们的服务器无法访问。请改用完整网址,或把图片以 data URI 形式嵌入 HTML。

PDF 是什么页面尺寸?

HTML 文件和粘贴的代码会转成 A4 页面,页边距 15 毫米;内容较长时自动分成多页,可用 CSS(如 page-break-before)控制分页位置。

能把网页链接转成 PDF 吗?

可以,使用 URL 模式即可。保存网页也可以用专门的 网页转 PDF 工具,纸张尺寸选择更多。

手机上怎么把 HTML 转成 PDF?

在手机浏览器中打开本页,上传 HTML 文件或粘贴代码后转换即可,无需安装 App。

可以转换 localhost 或公司内网页面吗?

不可以。出于安全考虑,服务器只加载公开网址,私有、本地和内网地址都会被拦截。请把页面另存为 .html 文件再上传。

文件安全吗?

安全。文件通过 HTTPS 加密传输,在服务器上的隔离浏览器中渲染,一小时内自动删除,不会分享给任何人,也不会用于训练 AI。

Use our other tools