pdf-creator

Convert Markdown to A4 PDFs with Chinese typography via WeasyPrint.

1.3k|212|Updated Oct 22, 2025
One-click install
npx skills add https://github.com/daymade/claude-code-skills --skill pdf-creator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf-creator
Source: https://github.com/daymade/claude-code-skills/tree/main/pdf-creator
Command: npx skills add https://github.com/daymade/claude-code-skills --skill pdf-creator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires markdown, weasyprint, and includes scripts (resource) components.

What problem does it solve?

This Skill converts Markdown to PDF with Chinese font support, enabling formal documents, legal filings, and reports that require precise typography.

Core Features & Use Cases

  • Markdown-to-PDF conversion with WeasyPrint
  • Chinese font support (Songti SC, Heiti SC) for body and headings
  • Batch conversion and configurable page layout (A4, margins)
  • Troubleshooting guidance for common font/display issues

Quick Start

  • Single file: uv run --with weasyprint --with markdown scripts/md_to_pdf.py input.md output.pdf

Frequently Asked Questions about pdf-creator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert Markdown to PDF with Chinese typography support?

Convert Markdown to PDF using WeasyPrint with built-in Chinese font support. This Skill renders Markdown as HTML, then generates A4 PDFs with Songti SC and Heiti SC fonts, proper margins (2.5 cm top/bottom, 2 cm sides), and 1.8 line height for formal documents and Chinese text.

Can I use this for legal documents and formal reports that need specific formatting?

Yes. This Skill produces formally-formatted A4 PDFs meeting layout requirements for legal filings, contracts, reports, and official letters. It enforces consistent 12pt body font, precise margins, and file sizes under 2 MB, making it suitable for professional and legal workflows.

What fonts does the PDF converter use for Chinese text?

The Skill uses Songti SC for body text and Heiti SC for headings, with automatic fallbacks to ensure Chinese characters render correctly. Both fonts are configured to work across formal document types.

Can I batch convert multiple Markdown files to PDF at once?

Yes. This Skill supports batch conversion of multiple Markdown files. You can process multiple documents in a single workflow, applying consistent formatting, Chinese typography, and file-size constraints across all outputs.

What are the file size and layout constraints for generated PDFs?

Generated PDFs are limited to 2 MB file size and use A4 layout with fixed margins: 2.5 cm top and bottom, 2 cm left and right. Body text is 12pt with 1.8 line height, ensuring consistent, print-ready output.

What should I do if Chinese fonts aren't displaying correctly in the PDF?

The Skill includes troubleshooting guidance for font and display issues. Check that Songti SC and Heiti SC are available on your system, verify WeasyPrint can access them, and consult the Skill's documentation for font-path configuration if characters appear missing or misaligned.