daymade

pdf-creator

@daymade/pdf-creator
daymade
148
13 forks
Updated 1/6/2026
View on GitHub

Create PDF documents from markdown with proper Chinese font support using weasyprint. This skill should be used when converting markdown to PDF, generating formal documents (legal, trademark filings, reports), or when Chinese typography is required. Triggers include "convert to PDF", "generate PDF", "markdown to PDF", or any request for creating printable documents.

Installation

$skills install @daymade/pdf-creator
Claude Code
Cursor
Copilot
Codex
Antigravity

Details

Pathpdf-creator/SKILL.md
Branchmain
Scoped Name@daymade/pdf-creator

Usage

After installing, this skill will be available to your AI coding assistant.

Verify installation:

skills list

Skill Instructions


name: pdf-creator description: Create PDF documents from markdown with proper Chinese font support using weasyprint. This skill should be used when converting markdown to PDF, generating formal documents (legal, trademark filings, reports), or when Chinese typography is required. Triggers include "convert to PDF", "generate PDF", "markdown to PDF", or any request for creating printable documents.

PDF Creator

Create professional PDF documents from markdown with proper Chinese font support.

Quick Start

Convert a single markdown file:

uv run --with weasyprint --with markdown scripts/md_to_pdf.py input.md output.pdf

Batch convert multiple files:

uv run --with weasyprint --with markdown scripts/batch_convert.py *.md --output-dir ./pdfs

macOS Environment Setup

If encountering library errors, set these environment variables first:

export DYLD_LIBRARY_PATH="/opt/homebrew/lib:$DYLD_LIBRARY_PATH"
export PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:$PKG_CONFIG_PATH"

Font Configuration

The scripts use these Chinese fonts (with fallbacks):

Font TypePrimaryFallbacks
Body textSongti SCSimSun, STSong, Noto Serif CJK SC
HeadingsHeiti SCSimHei, STHeiti, Noto Sans CJK SC

Output Specifications

  • Page size: A4
  • Margins: 2.5cm top/bottom, 2cm left/right
  • Body font: 12pt, 1.8 line height
  • Max file size: Designed to stay under 2MB for form submissions

Common Use Cases

  1. Legal documents: Trademark filings, contracts, evidence lists
  2. Reports: Business reports, technical documentation
  3. Formal letters: Official correspondence requiring print format

Troubleshooting

Problem: Chinese characters display as boxes Solution: Ensure Songti SC or other Chinese fonts are installed on the system

Problem: weasyprint import error Solution: Run with uv run --with weasyprint --with markdown to ensure dependencies

More by daymade

View all
markdown-tools
148

Converts documents to markdown (PDFs, Word docs, PowerPoint, Confluence exports) with Windows/WSL path handling. Activates when converting .doc/.docx/PDF/PPTX files to markdown, processing Confluence exports, handling Windows/WSL path conversions, extracting images from PDFs, or working with markitdown utility.

promptfoo-evaluation
148

Configures and runs LLM evaluation using Promptfoo framework. Use when setting up prompt testing, creating evaluation configs (promptfooconfig.yaml), writing Python custom assertions, implementing llm-rubric for LLM-as-judge, or managing few-shot examples in prompts. Triggers on keywords like "promptfoo", "eval", "LLM evaluation", "prompt testing", or "model comparison".

docs-cleaner
148

Consolidates redundant documentation while preserving all valuable content. This skill should be used when users want to clean up documentation bloat, merge redundant docs, reduce documentation sprawl, or consolidate multiple files covering the same topic. Triggers include "clean up docs", "consolidate documentation", "too many doc files", "merge these docs", or when documentation exceeds 500 lines across multiple files covering similar topics.

github-ops
148

Provides comprehensive GitHub operations using gh CLI and GitHub API. Activates when working with pull requests, issues, repositories, workflows, or GitHub API operations including creating/viewing/merging PRs, managing issues, querying API endpoints, and handling GitHub workflows in enterprise or public GitHub environments.