omk-pdf-gen

omk-pdf-gen is a skill for Claude Code, Codex from KaimingWan/oh-my-kiro. It costs 85 tokens per session (1,270 once invoked), scanned A, original, MIT.

A tool for creating PDF documents, including documents containing Chinese, Japanese, or Korean text.

In plain words
What is it for?
Use it to generate, export, or fix formatted PDFs such as quotes, budgets, and comparison documents.
Why use it?
It addresses common problems with PDF layout and missing or garbled characters in these writing systems.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to generate, export, or fix formatted PDFs such as quotes, budgets, and comparison documents.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kaimingwan/oh-my-kiro/omk-pdf-gen
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add KaimingWan/oh-my-kiro --skill omk-pdf-gen
Clone the repo
git clone --depth 1 https://github.com/KaimingWan/oh-my-kiro

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for omk-pdf-gen

README.md
[![agentmods](https://agentmods.dev/badge/skills/kaimingwan/oh-my-kiro/omk-pdf-gen/github.svg)](https://agentmods.dev/skills/kaimingwan/oh-my-kiro/omk-pdf-gen)
Your own site
<a href="https://agentmods.dev/skills/kaimingwan/oh-my-kiro/omk-pdf-gen"><img src="https://agentmods.dev/badge/skills/kaimingwan/oh-my-kiro/omk-pdf-gen/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for omk-pdf-gen

Your own site · 80×15
<a href="https://agentmods.dev/skills/kaimingwan/oh-my-kiro/omk-pdf-gen"><img src="https://agentmods.dev/badge/skills/kaimingwan/oh-my-kiro/omk-pdf-gen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,270 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00085 $0.01270
Opus 5 $0.00043 $0.00635
Sonnet 5 $0.00017 $0.00254
Haiku 4.5 $0.00009 $0.00127

Measured 12d ago against content hash 5f60d96e7e11, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

omk-pdf-gen scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

subprocess.run(['weasyprint', html_tmp, output_path], check=True)
skills/omk-pdf-gen/SKILL.md · 122 lines

How it starts

The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 canvas API 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

HTML = """\
<!DOCTYPE html>
<html lang="zh">
<head><meta charset="utf-8">
<style>
@page { size: A4; margin: 2cm 2.2cm; }
body { font-family: "Hiragino Sans GB", "Heiti SC", "Noto Sans CJK SC", sans-serif; ... }
</style></head>
<body>...</body></html>
"""

Step 2: Write to temp HTML, convert, clean up

import subprocess, os
html_tmp = output_path.replace('.pdf', '.html')
with open(html_tmp, 'w', encoding='utf-8') as f:
    f.write(HTML)
subprocess.run(['weasyprint', html_tmp, output_path], check=True)
os.remove(html_tmp)

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:

fc-list :lang=zh family | head -10

Styling Best Practices

Read the full file on GitHub · 122 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 122 lines · 85 tokens per session scan A 5f60d96e7e11

Subscribe to this mod's changes

omk-pdf-gen is a skill published in the GitHub repository KaimingWan/oh-my-kiro (103 stars, last pushed 5mo ago), licensed MIT. It adds 85 tokens to every session and 1,270 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories