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