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.
96
93%
Does it follow best practices?
Impact
100%
3.57xAverage score across 3 eval scenarios
Passed
No known issues
Create professional PDF documents from markdown with proper Chinese font support.
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.pdfBatch convert multiple files:
uv run --with weasyprint --with markdown scripts/batch_convert.py *.md --output-dir ./pdfsmacOS ARM (Homebrew) 的 DYLD_LIBRARY_PATH 会自动检测配置,无需手动设置。
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 |
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
392d34c
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.