kaimingwan/oh-my-kiro/omk-pdf-gen
Claude Code and agent skill by kaimingwan/oh-my-kiro
- community
Checking that the SKILL.md file is still in the repository.
Generate professional PDF documents with correct CJK (Chinese/Japanese/Korean) rendering. Trigger when user says 'generate PDF', 'create PDF', 'export PDF', '生成 PDF', '导出 PDF', '做个 PDF', 'make a PDF', or when any task requires producing a PDF file. Also trigger when user mentions PDF formatting issues, garbled text, or font problems.
Install
npx vskill@latest install kaimingwan/oh-my-kiro/omk-pdf-genSKILL.md
PDF Generation Skill
Trigger Examples
- "帮我生成一个报价 PDF"
- "把这个内容导出成 PDF"
- "PDF 中文乱码怎么办"
- "generate a comparison PDF for this customer"
- "create a budget proposal PDF"
Approach: HTML + weasyprint
Use HTML + CSS → weasyprint pipeline. Do NOT use reportlab for documents containing CJK text.
Why:
- reportlab CID fonts (STSong-Light) have incomplete glyph coverage — symbols like
•render as garbage (e.g. "煉") - reportlab cannot read macOS SIP-protected TTC fonts (PingFang etc.)
- reportlab
canvasAPI requires manual coordinate positioning — fragile and ugly - weasyprint uses system fontconfig — correct font resolution out of the box
Workflow
Step 1: Write HTML string in Python
Step 2: Write to temp HTML, convert, clean up
Font Rules (Critical)
| Platform | CSS font-family | Notes | |
|---|---|---|---|
| macOS | "Hiragino Sans GB", "Heiti SC" | Verified via fc-list :lang=zh | |
| Linux | "Noto Sans CJK SC", "WenQuanYi Micro Hei" | Install fonts-noto-cjk if missing | |
| Fallback | sans-serif | Always include as last resort |
Never use these in weasyprint CSS:
-apple-system— weasyprint doesn't understand Apple system font aliases"PingFang SC"— fontconfig often can't resolve it even though macOS has it"STSong-Light"— CID font name, not a real font family for CSS
Before generating, verify CJK fonts are available:
Styling Best Practices
Use standard HTML elements — weasyprint handles them well:
<table>with CSSborder-collapse: collapsefor data tables<ul>/<li>for bullet lists (no manual bullet symbols needed)<h1>-<h3>for headings<hr>for dividers- CSS
@pagefor margins and page size
Recommended CSS skeleton
When reportlab IS acceptable
English-only documents where you need precise programmatic layout (charts, diagrams, pixel-perfect positioning). Use platypus (SimpleDocTemplate + Paragraph + Table), never raw canvas API.
Reference: tools/gen-73strings-pdfs.py — good example of reportlab platypus for English PDFs.
Anti-Patterns (from real incidents)
| Don't | Why | Do Instead | |
|---|---|---|---|
| reportlab + STSong-Light for CJK | • → "煉", incomplete glyphs | weasyprint + system fonts | |
reportlab canvas manual positioning | Fragile coordinates, misaligned text | weasyprint or reportlab platypus | |
CSS font-family: -apple-system | weasyprint can't resolve it | Use "Hiragino Sans GB" | |
CSS font-family: "PingFang SC" | fontconfig often fails to find it | Use "Hiragino Sans GB" | |
| Helvetica-Bold for table headers with CJK | CJK chars render as ■■■ | Use CJK font + font-weight: bold | |
| Hardcode font without checking | Fails on different OS | Run fc-list :lang=zh first |
Output
Place generated script in tools/gen-<name>-pdf.py. The script should:
- Define HTML as a string constant
- Write temp HTML → call weasyprint → remove temp HTML
- Print the output path on success
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/omk-pdf-gen/SKILL.md
Popularity
- Repository stars
- 92
- Repository forks
- 14
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 May 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kaimingwan/oh-my-kiro/omk-pdf-gen)