开发工具
文本工具
图片工具
PDF工具
数据转换
实用工具
博客
语言
切换主题
菜单
Welcome to RunToolz!
关闭菜单
开发工具
正则表达式测试器
Base64编码/解码器
颜色转换器
JWT解码器
代码压缩/美化
URL编码/解码器
UUID生成器
哈希生成器
时间戳转换器
Cron表达式解析器
HTTP状态码
User Agent解析器
文本工具
JSON格式化器
字符计数器
文本比较
Markdown编辑器
SQL格式化器
图片工具
图片转换器
图片调整大小
图片压缩
图片裁剪
SVG优化器
网站图标生成器
图片转Base64
图片矢量化
PDF工具
PDF合并
PDF转图片
PDF拆分
HTML转PDF
数据转换
CSV转JSON
YAML转JSON
XML转JSON
实用工具
二维码生成器
密码生成器
单位转换器
条形码生成器
Lorem Ipsum生成器
博客
关于我们
隐私政策
使用条款
联系我们
浅色模式
深色模式
语言
简体中文
HTML转PDF
将HTML内容转换为PDF文档。
文件名
页面大小
方向
HTML内容
<!DOCTYPE html> <html> <head> <style> body { font-family: Arial, sans-serif; padding: 20px; line-height: 1.6; } h1 { color: #333; border-bottom: 2px solid #c96442; padding-bottom: 10px; } h2 { color: #555; margin-top: 20px; } p { color: #666; } .highlight { background-color: #fff3cd; padding: 10px; border-radius: 4px; } table { width: 100%; border-collapse: collapse; margin: 20px 0; } th, td { border: 1px solid #ddd; padding: 8px; text-align: left; } th { background-color: #f4f4f4; } </style> </head> <body> <h1>Sample Document</h1> <p>This is a sample HTML document that will be converted to PDF.</p> <h2>Features</h2> <ul> <li>Supports basic HTML and CSS</li> <li>Multiple page sizes available</li> <li>Portrait and landscape orientations</li> <li>All processing done in browser</li> </ul> <div class="highlight"> <strong>Note:</strong> Complex CSS may not render perfectly. For best results, use simple styling. </div> <h2>Sample Table</h2> <table> <tr><th>Feature</th><th>Supported</th></tr> <tr><td>Basic HTML</td><td>Yes</td></tr> <tr><td>Inline CSS</td><td>Yes</td></tr> <tr><td>Images</td><td>Yes (base64)</td></tr> </table> </body> </html>
预览
显示
点击"显示"预览HTML
生成PDF
使用方法
在编辑器中输入或粘贴HTML内容
设置文件名、页面大小和方向
如需要可预览内容
点击"生成PDF"创建并下载PDF
常见问题
支持哪些HTML/CSS?
可以包含图片吗?
有哪些页面大小可用?
我的数据安全吗?
相关工具
PDF合并
将多个PDF文件合并为一个
Markdown编辑器
编写和预览Markdown
代码压缩/美化
压缩或美化JS、CSS、HTML代码