Token导航 LogoToken导航

Agent Skill · 前端设计

html-to-pdf(HTML TO PDF 搜索)

html-to-pdf 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

html-to-pdf 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描有未通过项,按安装量在前端设计类的 10,216 个 Skill 里排第 8,923。

总安装 247周安装 10GitHub Stars 公开资料未说明下载 78核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:html-to-pdf(HTML TO PDF 搜索)
来源仓库:https://github.com/yonggao/claude-plugins
仓库路径:skills/html-to-pdf
安装命令:
npx skills add https://github.com/yonggao/claude-plugins --skill html-to-pdf
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/yonggao/claude-plugins --skill html-to-pdf

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

html-to-pdf 用于将 HTML 内容转换为 PDF 文档。适合在前端设计中快速生成可打印或分享的静态文档。通过 npx skills add 命令从指定 GitHub 仓库安装并使用。安装前需确认权限范围和维护状态,注意可能涉及文件生成和网络请求。

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/html-to-pdf

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/yonggao/claude-plugins --skill html-to-pdf;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

html-to-pdf 怎么安装?

在终端执行 npx skills add https://github.com/yonggao/claude-plugins --skill html-to-pdf。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

html-to-pdf 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

html-to-pdf 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

html-to-pdf 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

html-to-pdf 用的人多吗?

公开数据是累计安装 247 次,近一周安装 10 次,下载 78 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

html-to-pdf 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
html-to-pdf

HTML TO PDF 搜索 · 本页

247—操作浏览器未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

HTML to PDF/PNG Converter Skill

This skill helps you convert HTML files to PDF or PNG format with various options for output quality and page layout.

When to Use This Skill

Use this skill when the user wants to:

  • Convert HTML files to PDF
  • Generate PNG screenshots from HTML
  • Create printable documents from web pages
  • Export HTML reports as PDFs
  • Generate long-form images without page breaks
  • Create presentation-ready PDFs from HTML

Available Conversion Methods

Method 1: Multi-Page PDF (Standard A4)

Best for: Printing, archiving, traditional documents

Command:

python html_to_pdf_final.py input.html output.pdf

Features:

  • Standard A4 page format
  • Zero margins for seamless appearance
  • Background colors and gradients preserved
  • Multiple pages with page breaks
  • Optimized file size (~5-6 MB for typical reports)

Method 2: Single-Page Long Image PDF

Best for: Online viewing, presentations, no page breaks

Command:

python html_to_long_image.py input.html

Features:

  • Generates a full-page PNG screenshot first
  • Converts PNG to single-page PDF
  • NO page breaks - entire content on one page
  • Perfect for presentations and online viewing
  • Smaller file size (~1-2 MB)
  • Two output files: .png and .pdf

Method 3: Advanced Multi-Method Converter

Best for: Fallback options, compatibility

Command:

python html_to_pdf_converter.py input.html output.pdf

Features:

  • Tries WeasyPrint first (best CSS support)
  • Falls back to Playwright if needed
  • Automatic dependency installation
  • Handles complex CSS and gradients

Required Dependencies

The skill requires Playwright and Pillow. The scripts auto-install dependencies if missing:

pip install playwright pillow pypdf
playwright install chromium

Step-by-Step Instructions

For Standard Multi-Page PDF:

  1. Verify the HTML file exists: ls -la *.html
  2. Run the converter: python html_to_pdf_final.py your_file.html
  3. Open the result: open your_file_final.pdf

For Single-Page Long Image PDF:

  1. Verify the HTML file exists: ls -la *.html
  2. Run the long image converter: python html_to_long_image.py your_file.html
  3. Check outputs: # View the PNG screenshot open your_file_fullpage.png # View the PDF version open your_file_fullpage.pdf

Troubleshooting

Issue: Playwright browser not found

Solution:

playwright install chromium

Issue: Page breaks visible in PDF

Solution: Use the long image method instead:

python html_to_long_image.py your_file.html

Issue: Content appears cut off

Causes & Solutions:

  • CSS animations not complete: Script waits 2 seconds for animations
  • Lazy loading: Script scrolls through entire page to trigger loading
  • Large file size: Scripts handle files up to 20MB+

Issue: Blank PDF output

Solution: Use the long image method which uses screenshot instead of PDF rendering:

python html_to_long_image.py your_file.html

Output Files

After conversion, you'll get:

Multi-Page PDF:

  • filename_final.pdf - Standard A4 multi-page PDF

Long Image Method:

  • filename_fullpage.png - Complete screenshot as PNG (6-10 MB)
  • filename_fullpage.pdf - Single-page PDF from image (1-2 MB)

Best Practices

  1. For online viewing/presentations: Use html_to_long_image.py

- No page breaks - Smooth scrolling experience - Smaller file size

  1. For printing/archiving: Use html_to_pdf_final.py

- Standard A4 pages - Better for physical printing - Professional document format

  1. For complex CSS: Use html_to_pdf_converter.py

- Multiple fallback methods - Better compatibility

Implementation Notes

Script Locations

All scripts should be in the project directory:

  • html_to_pdf_final.py - Main multi-page converter
  • html_to_long_image.py - Long image generator
  • html_to_pdf_converter.py - Advanced multi-method converter

Key Features Implemented

  1. Animation Handling: All scripts disable CSS animations/transitions
  2. Lazy Loading: Scripts scroll through content to trigger loading
  3. Background Preservation: All gradients and colors render correctly
  4. Zero Margins: Seamless page appearance without visible borders
  5. Chinese Font Support: Handles CJK characters properly

Examples

Example 1: Convert BP Report to Multi-Page PDF

python html_to_pdf_final.py 202510_Alpha_Intelligence_BP.html
# Output: 202510_Alpha_Intelligence_BP_final.pdf (22 pages, 5.7 MB)

Example 2: Create Single-Page Presentation PDF

python html_to_long_image.py 202510_Alpha_Intelligence_BP.html
# Output:
#   - 202510_Alpha_Intelligence_BP_fullpage.png (6.1 MB)
#   - 202510_Alpha_Intelligence_BP_fullpage.pdf (1.6 MB, 1 page)

Example 3: Batch Convert Multiple Files

for file in *.html; do
    python html_to_long_image.py "$file"
done

Advanced Usage

Custom Output Paths

python html_to_pdf_final.py input.html custom_output.pdf
python html_to_long_image.py input.html

Check PDF Page Count

python -c "from pypdf import PdfReader; r = PdfReader('output.pdf'); print(f'Pages: {len(r.pages)}')"

Verify File Sizes

ls -lh *.pdf *.png

Performance Expectations

  • Processing Speed: ~5-10 seconds for typical HTML files
  • Memory Usage: ~100-200 MB during conversion
  • PDF File Size: 1-6 MB depending on method
  • PNG File Size: 6-10 MB for full-page screenshots

Success Criteria

A successful conversion should:

  1. ✅ Generate PDF/PNG without errors
  2. ✅ Include all HTML content (no truncation)
  3. ✅ Preserve colors, gradients, and styling
  4. ✅ Handle Chinese/CJK characters correctly
  5. ✅ Create readable file sizes (< 10 MB)

Quick Reference

NeedUseOutput
Printinghtml_to_pdf_final.pyMulti-page A4 PDF
Online viewinghtml_to_long_image.pySingle-page PDF + PNG
Maximum compatibilityhtml_to_pdf_converter.pyMulti-page PDF with fallbacks

平台分布

Codex

34.14%
按下载量换算27

Claude

32.68%
按下载量换算25

Cursor

20.01%
按下载量换算16

Gemini CLI

8.51%
按下载量换算7

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills