P
pdf-creator
by @daymadev1.0.0
0.0(0)
使用weasyprint从Markdown创建支持中文的PDF文档,适用于生成正式文件。
安装方式
npx skills add daymade/claude-code-skills --skill pdf-creatorcompare_arrows
Before / After 效果对比
1 组使用前
1将包含中文内容的 Markdown 文档转换为 PDF 时,常常遇到字体缺失、排版混乱等问题,需要手动调整字体配置或使用复杂的工具链,例如:
2```markdown
3# 报告标题
4
5这是一段**中文**内容。
6
7- 列表项一
8- 列表项二
9```
10使用普通工具转换后,中文字符可能显示为乱码或方块。使用后
1使用 PDF Creator 技能,可以轻松地将 Markdown 文档转换为高质量的 PDF,并自动处理中文字体支持和排版,确保文档的专业性和可读性:
2```bash
3/pdf-creator convert input.md output.pdf --chinese-font-support
4```
5转换后的 PDF 将正确显示中文字体,排版整洁,适用于正式文档。description SKILL.md
name: pdf-creator description: Create PDF documents from markdown with proper Chinese font support using weasyprint. This skill should be used when converting markdown to PDF, generating formal documents (legal, trademark filings, reports), or when Chinese typography is required. Triggers include "convert to PDF", "generate PDF", "markdown to PDF", or any request for creating printable documents.
PDF Creator
Create professional PDF documents from markdown with proper Chinese font support.
Quick Start
Convert a single markdown file:
cd /Users/tiansheng/Workspace/python/claude-code-skills/pdf-creator
uv run --with weasyprint --with markdown scripts/md_to_pdf.py input.md output.pdf
Batch convert multiple files:
uv run --with weasyprint --with markdown scripts/batch_convert.py *.md --output-dir ./pdfs
macOS ARM (Homebrew) 的 DYLD_LIBRARY_PATH 会自动检测配置,无需手动设置。
Font Configuration
The scripts use these Chinese fonts (with fallbacks):
| Font Type | Primary | Fallbacks |
|---|---|---|
| Body text | Songti SC | SimSun, STSong, Noto Serif CJK SC |
| Headings | Heiti SC | SimHei, STHeiti, Noto Sans CJK SC |
Output Specifications
- Page size: A4
- Margins: 2.5cm top/bottom, 2cm left/right
- Body font: 12pt, 1.8 line height
- Max file size: Designed to stay under 2MB for form submissions
Common Use Cases
- Legal documents: Trademark filings, contracts, evidence lists
- Reports: Business reports, technical documentation
- Formal letters: Official correspondence requiring print format
Troubleshooting
Problem: Chinese characters display as boxes Solution: Ensure Songti SC or other Chinese fonts are installed on the system
Problem: weasyprint import error
Solution: Run with uv run --with weasyprint --with markdown to ensure dependencies
forum用户评价 (0)
发表评价
效果
易用性
文档
兼容性
暂无评价,来写第一条吧
统计数据
安装量0
评分0.0 / 5.0
版本1.0.0
更新日期2026年3月17日
对比案例1 组
用户评分
0.0(0)
5
0%
4
0%
3
0%
2
0%
1
0%
为此 Skill 评分
0.0
兼容平台
🔧Claude Code
时间线
创建2026年3月17日
最后更新2026年3月17日