md-to-pdf

Use this skill when users want to convert Markdown files to PDF. Handles workflows like "Convert this markdown to PDF", "转换为PDF", "批量转换MD文件". Supports single file and batch directory conversion with excellent CJK (Chinese) font support, image embedding, and clean typography.

7 stars

Best use case

md-to-pdf is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Use this skill when users want to convert Markdown files to PDF. Handles workflows like "Convert this markdown to PDF", "转换为PDF", "批量转换MD文件". Supports single file and batch directory conversion with excellent CJK (Chinese) font support, image embedding, and clean typography.

Teams using md-to-pdf should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/md-to-pdf/SKILL.md --create-dirs "https://raw.githubusercontent.com/Jst-Well-Dan/Skill-Box/main/productivity/md-to-pdf/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/md-to-pdf/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How md-to-pdf Compares

Feature / Agentmd-to-pdfStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Use this skill when users want to convert Markdown files to PDF. Handles workflows like "Convert this markdown to PDF", "转换为PDF", "批量转换MD文件". Supports single file and batch directory conversion with excellent CJK (Chinese) font support, image embedding, and clean typography.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Markdown to PDF Converter

Convert Markdown files to beautifully formatted PDF documents with full CJK (Chinese/Japanese/Korean) font support.

## Features

- Excellent Chinese (CJK) font support using Microsoft YaHei
- Image rendering support (HTTP/HTTPS URLs and local paths)
- Automatic image scaling with aspect ratio preservation
- Single file and batch directory conversion
- Clean, readable typography optimized for Chinese content
- Concurrent batch processing with progress tracking

## Dependencies

```bash
pip install reportlab markdown beautifulsoup4 html5lib tqdm
```

## Usage

### Single file

```bash
# Auto-generates output name (same name with .pdf extension)
python scripts/md_to_pdf.py article.md

# Custom output name
python scripts/md_to_pdf.py article.md --output custom_name.pdf
```

### Batch convert directory

```bash
python scripts/md_to_pdf.py ./articles_folder --concurrency 4
```

## Response Pattern

When user requests Markdown to PDF conversion:

1. **Identify input:**
   - Single file → direct conversion
   - Directory → batch conversion

2. **Execute conversion:**
   ```bash
   # Single file
   python scripts/md_to_pdf.py <markdown_file> [--output output.pdf]

   # Batch directory
   python scripts/md_to_pdf.py <directory> [--concurrency 4]
   ```

3. **Report results:**
   - Confirm output file path and size
   - For batch: show success/failure counts and total size

## Example Workflows

### Single file conversion

```bash
# User: "把这个markdown转成PDF"
python scripts/md_to_pdf.py article.md

# Result:
# ✅ Output: article.pdf (128.5 KB)
```

### Batch conversion

```bash
# User: "批量转换这个文件夹里的所有markdown"
python scripts/md_to_pdf.py ./articles --concurrency 4

# Result:
# ✅ Success: 15 files
# ❌ Failed: 0 files
# 📦 Total size: 2.35 MB
```

## Troubleshooting

| Issue | Solution |
|-------|----------|
| PDF conversion failed | Install: `pip install reportlab markdown beautifulsoup4` |
| Chinese characters garbled | Microsoft YaHei font is auto-detected; ensure Windows fonts are available |
| Images missing in PDF | Check that image URLs are accessible or local paths are correct |
| PDF too large | Images are embedded at original resolution; consider pre-compressing images |

Related Skills

theme-factory

7
from Jst-Well-Dan/Skill-Box

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

slack-gif-creator

7
from Jst-Well-Dan/Skill-Box

Toolkit for creating animated GIFs optimized for Slack, with validators for size constraints and composable animation primitives. This skill applies when users request animated GIFs or emoji animations for Slack from descriptions like "make me a GIF for Slack of X doing Y".

remotion-best-practices

7
from Jst-Well-Dan/Skill-Box

Best practices for Remotion - Video creation in React

image-enhancer

7
from Jst-Well-Dan/Skill-Box

Improves the quality of images, especially screenshots, by enhancing resolution, sharpness, and clarity. Perfect for preparing images for presentations, documentation, or social media posts.

canvas-design

7
from Jst-Well-Dan/Skill-Box

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

algorithmic-art

7
from Jst-Well-Dan/Skill-Box

Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.

raffle-winner-picker

7
from Jst-Well-Dan/Skill-Box

Picks random winners from lists, spreadsheets, or Google Sheets for giveaways, raffles, and contests. Ensures fair, unbiased selection with transparency.

nlm-skill

7
from Jst-Well-Dan/Skill-Box

Expert guide for the NotebookLM CLI (`nlm`) and MCP server - interfaces for Google NotebookLM. Use this skill when users want to interact with NotebookLM programmatically, including: creating/managing notebooks, adding sources (URLs, YouTube, text, Google Drive), generating content (podcasts, reports, quizzes, flashcards, mind maps, slides, infographics, videos, data tables), conducting research, chatting with sources, or automating NotebookLM workflows. Triggers on mentions of "nlm", "notebooklm", "notebook lm", "podcast generation", "audio overview", or any NotebookLM-related automation task.

markdown-to-epub-converter

7
from Jst-Well-Dan/Skill-Box

Convert markdown documents and chat summaries into formatted EPUB ebook files that can be read on any device or uploaded to Kindle.

xlsx

7
from Jst-Well-Dan/Skill-Box

Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas

pptx

7
from Jst-Well-Dan/Skill-Box

Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks

pdf

7
from Jst-Well-Dan/Skill-Box

Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.