doc-pdf

doc-pdf is a skill for Claude Code from modu-ai/moai-cowork. It costs 406 tokens per session (3,682 once invoked), scanned A, original, Apache-2.0.

A PDF generator that turns styled HTML, Markdown, JSON, or plain text into a PDF file. It preserves CSS-based layouts and embeds fonts for Korean, Japanese, and Chinese text.

In plain words
What is it for?
It helps export designed HTML reports, Markdown documents, structured data, and text as A4 PDFs with tables, styling, and multilingual text.
Why use it?
It removes the need to rebuild a document's layout manually for PDF output. It also reduces missing-character problems in documents that use East Asian languages.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the moai-officer plugin — 13 skills, 2 agents shipped together

Good fit It helps export designed HTML reports, Markdown documents, structured data, and text as A4 PDFs with tables, styling, and multilingual text.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add modu-ai/moai-cowork
Claude Code
/plugin install moai-officer

Made for: Claude Code.

Or install moai-officer, the plugin that ships this one along with the rest of its 13 skills, 2 agents.

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 doc-pdf

README.md
[![agentmods](https://agentmods.dev/badge/skills/modu-ai/moai-cowork/doc-pdf/github.svg)](https://agentmods.dev/skills/modu-ai/moai-cowork/doc-pdf)
Your own site
<a href="https://agentmods.dev/skills/modu-ai/moai-cowork/doc-pdf"><img src="https://agentmods.dev/badge/skills/modu-ai/moai-cowork/doc-pdf/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 doc-pdf

Your own site · 80×15
<a href="https://agentmods.dev/skills/modu-ai/moai-cowork/doc-pdf"><img src="https://agentmods.dev/badge/skills/modu-ai/moai-cowork/doc-pdf.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 406 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,682 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00406 $0.03682
Opus 5 $0.00203 $0.01841
Sonnet 5 $0.00081 $0.00736
Haiku 4.5 $0.00041 $0.00368

Measured 6d ago against content hash e6c3cd9eafde, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

doc-pdf scanned grade A with 0 findings 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 6d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/moai-officer/skills/doc-pdf/SKILL.md · 210 lines

How it starts

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

PDF 생성기 (doc-pdf)

개요

weasyprint 단일 엔진으로 모든 입력을 PDF로 렌더합니다. 입력 형태와 무관하게 입력 → HTML → weasyprint → PDF 한 경로로 통일되어, 다음 두 시나리오를 모두 충실히 처리합니다.

  1. 스타일이 입혀진 HTML 리포트 (예: moai-officer:doc-html-report·moai-officer:doc-html-slide 산출물, 또는 사용자가 만든 디자인 HTML) → 자체 CSS를 그대로 렌더해 화면 디자인을 보존합니다. 2열 카드 그리드·커스텀 색·웹폰트 등 모던 CSS 레이아웃이 깨지지 않습니다.
  2. Markdown · 구조화 JSON · 일반 텍스트 → 기본 문서 서식(A4·표·제목 스타일)을 적용해 렌더합니다.

CJK(한·중·일) 글리프는 번들 Noto Sans CJK 폰트를 @font-face로 임베딩해 깨짐을 차단하며, 시스템에 Noto Sans CJK KR이 설치돼 있으면 fontconfig가 자동 폴백합니다.

왜 weasyprint 단일 엔진인가: weasyprint는 풀 CSS(레이아웃·색·웹폰트·표)를 충실히 렌더합니다. "이 HTML 리포트를 디자인 그대로 PDF로"가 가장 흔한 요청이며, 이 경로가 그 요구를 정확히 만족합니다. 좌표 기반 저수준 렌더링(예: PyMuPDF insert_text)은 모던 CSS 레이아웃을 재현하지 못하므로 사용하지 않습니다.

워크플로우

0. [폰트 확인]  → 시스템 Noto Sans CJK KR 존재 확인, 없으면 폰트 미지정 폴백 (weasyprint fontconfig 자동 폴백)
1. [입력 감지]  → HTML(완성 문서) / Markdown / JSON / Text 자동 감지
2. [HTML 빌드]  → 완성 HTML은 그대로, 그 외는 HTML로 변환 (+ 기본 문서 CSS)
3. [폰트 주입]  → Noto Sans CJK @font-face CSS 결합 (CJK 깨짐 방지)
4. [렌더]       → weasyprint HTML.write_pdf() 로 A4 PDF 생성
5. [자체 검수]  → 산출 PDF 재확인 (페이지 수·CJK 표시·플레이스홀더 잔존)

핵심 실행은 아래 인라인 weasyprint 코드로 직접 수행합니다(별도 스크립트 없음). 입력 파일 확장자·내용으로 HTML / Markdown / JSON / Text를 감지해 분기하고, 완성 HTML은 자체 CSS를 보존한 채, 그 외는 기본 서식 + Noto Sans CJK를 적용합니다.

0단계: 폰트 보장 (조건부 경로)

CJK 폰트는 다음 우선순위로 해결합니다 — 별도 다운로드 스크립트 없이:

  1. 시스템 폰트 우선: 시스템에 Noto Sans CJK KR이 설치돼 있으면 weasyprint fontconfig가 자동 폴백하므로 @font-face 없이도 CJK가 안전하게 표시됩니다. 대부분의 Cowork 샌드박스·Linux/macOS가 이에 해당합니다.

  2. 번들 폰트가 있으면 임베딩: ${CLAUDE_PLUGIN_ROOT}/skills/doc-pdf/assets/fonts/에 Noto Sans CJK OTF가 있으면 아래 코드의 @font-face가 자동으로 임베딩합니다(있으면 사용, 없으면 1번 폴백).

  3. 둘 다 없을 때: 사용자에게 시스템 Noto Sans CJK KR 설치를 안내합니다. 운영체제별 명령은 아래와 같으며, 자동 대량 다운로드는 수행하지 않습니다.

    OS 설치
    Windows fonts.google.com/noto/specimen/Noto+Sans+KR에서 받아 압축 해제 → 폰트 파일 전체 선택 → 우클릭 → 설치
    macOS brew install --cask font-noto-sans-cjk-kr
    Debian/Ubuntu apt install fonts-noto-cjk

Read the full file on GitHub · 210 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 6d ago First seen · 210 lines · 406 tokens per session scan A e6c3cd9eafde

Subscribe to this mod's changes

doc-pdf is a skill published in the GitHub repository modu-ai/moai-cowork (298 stars, last pushed 7d ago), licensed Apache-2.0. It adds 406 tokens to every session and 3,682 once invoked, about $0.0020 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories