pdf-creator
БесплатноЗапускает вложенные скриптыНе проверенConverts Markdown to print-ready PDF with proper Chinese typography, themes and a visual self-check. Use for Markdown → PDF, including documents formatted for…
от daymade★ 1 556 звёзд на GitHubОб этом скилле
PDF Creator
Create professional PDF documents from markdown with Chinese font support and theme system.
For an existing .docx source, use docx-creator/references/word-to-pdf.md instead.
Choose by the authoritative input as well as the output suffix.
When adapting a manufacturer PDF manual into a concise Chinese illustrated recipient guide, read the illustrated-manual workflow before drafting. Continue through this Skill's normal theme, backend and visual self-check requirements after assembling the Markdown source.
For source changes, follow maintainer testing for the complete test environment and native-backend acceptance. Keep this source-checkout workflow separate from ordinary installed-Skill use.
Quick Start
Every scripts/… path below is relative to this skill's own directory — run the commands from there, or substitute the absolute path. Running them from the directory holding your markdown fails with Failed to spawn: 'scripts/md_to_pdf.py'. Omitting the output path is allowed and derives it from the input's basename (input.md → input.pdf, in the input's directory).
Keep relative image paths relative to the input Markdown file's directory. The converter uses that directory for both backends, including when its temporary HTML and the command's working directory are elsewhere.
# Default theme
uv run --with weasyprint scripts/md_to_pdf.py input.md output.pdf
# Source directory and filename containing spaces and Chinese
uv run --with weasyprint scripts/md_to_pdf.py \
"guide source/操作指南.md" "guide source/操作指南.pdf"
# Use a named theme
uv run --with weasyprint scripts/md_to_pdf.py input.md --theme warm-terra
# Mobile theme
uv run --with weasyprint scripts/md_to_pdf.py input.md --theme mobile
# Batch convert all markdown files with a specific theme
uv run --with weasyprint scripts/batch_convert.py *.md --theme warm-terra --no-preview
# No weasyprint? Use Chrome backend (auto-detected if weasyprint unavailable)
python scripts/md_to_pdf.py input.md --theme warm-terra --backend chrome
# List available themes
python scripts/md_to_pdf.py --list-themes dummy.md
Themes
Use --list-themes from Quick Start to read the available theme names and
descriptions. Read themes/*.css for page geometry, font
stacks, colors and per-theme layout rules.
To create a new theme: copy themes/default.css, modify, save as themes/your-theme.css.
Print vs Mobile: Choose the Right Theme
| Scenario | Recommended Theme | Why |
|---|---|---|
| Print on A4 paper, handouts, contracts | default |
Print layout |
| Training materials, course outlines | warm-terra |
Training layout |
| Send via WeChat, read on phone | mobile |
Phone layout |
| Both print AND mobile needed | Run twice with different themes | The skill is fast; generate both versions |
Decision rule: If the user does not specify, default to warm-terra for training/course content and default for formal documents — but pick cjk-auto over default when the document's tables have uneven column content (schedules, itemized lists). Ask "是否需要手机版?" only when the output channel is unclear.
Backends
The script auto-detects the best available backend from content × theme — the theme half matters because the reason CJK ever needed Chrome is a property of the theme's font stack, not of the text being Chinese:
- CJK + a Songti/Heiti theme (
default,cjk-auto) → weasyprint. These themes embed CID TrueType, which every reader renders, so Chrome buys nothing and costs the clip described below. - CJK + a PingFang theme (
warm-terra,mobile,warm-terra-menu, and any theme not on the safe list) → Chrome. weasyprint subset-embeds PingFang SC as CID Type 0C OpenType, which macOS Preview / Adobe Reader fail to render — garbled text on the recipient's device even though Chrome's own PDF viewer looks fine. - Non-CJK content → weasyprint (faster, no browser startup).
Routing is pinned by scripts/tests/test_backend_routing.py. A theme you add yourself is treated as PingFang-class until you add it to _WEASYPRINT_SAFE_CJK_THEMES in md_to_pdf.py — do that only after confirming its CJK faces are CID TrueType.
| Backend | Install | Pros | Cons |
|---|---|---|---|
weasyprint |
pip install weasyprint |
Precise CSS rendering, no browser needed, does not clip overflow | Subsets PingFang SC as CID Type 0C — unreadable in Preview/Adobe |
chrome |
Google Chrome installed, or Microsoft Edge on Windows | Zero Python deps, renders PingFang correctly | Clips anything past the @page box (see below) |
Override with --backend chrome or --backend weasyprint; an explicit flag always wins over auto-detection.
The theme does not tell you which backend ran. When we
Установить pdf-creator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл pdf-creator?
Converts Markdown to print-ready PDF with proper Chinese typography, themes and a visual self-check. Use for Markdown → PDF, including documents formatted for printing or mobile reading. Not for Word/WPS files or Word output (use docx-creator).
Как установить скилл pdf-creator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pdf-creator запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic