# Md To PDF

> Convert markdown files to clean, formatted PDFs using reportlab

- Skill: `jasoft/md-to-pdf` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add jasoft/md-to-pdf`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jasoft/md-to-pdf/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: jasoft (https://skillmd.com/u/jasoft)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/jasoft/md-to-pdf

---


# Markdown to PDF

Convert markdown documents to professional, clean PDFs with proper formatting.

## Usage

```bash
# Basic usage
uv run scripts/md-to-pdf.py input.md

# Specify output
uv run scripts/md-to-pdf.py input.md -o output.pdf
uv run scripts/md-to-pdf.py input.md --output my-report.pdf

# Verbose mode
uv run scripts/md-to-pdf.py input.md -v
```

## Features

- **Headers**: H1-H6 with hierarchical styling
- **Text formatting**: Bold, italic, inline code
- **Lists**: Bullet lists, numbered lists, task lists
- **Code blocks**: Syntax highlighting with background
- **Tables**: Full table support with headers
- **Links**: Clickable hyperlinks
- **Horizontal rules**: Visual section dividers
- **YAML frontmatter**: Automatically skipped
- **Special characters**: Emojis, Unicode symbols
- **CJK text**: Auto-detects Chinese content and loads a local fallback font when available
- **Page numbers**: Automatic footer with page numbers
- **Professional styling**: Clean, readable output

## Options

- `-o, --output`: Output PDF file path (default: input_filename.pdf)
- `-v, --verbose`: Print detailed processing information

## Supported Markdown Elements

| Element | Syntax | Status |
|---------|--------|--------|
| Headers | `# H1` to `###### H6` | ✅ |
| Bold | `**text**` or `__text__` | ✅ |
| Italic | `*text*` or `_text_` | ✅ |
| Inline code | `` `code` `` | ✅ |
| Code blocks | ``` | ✅ |
| Bullet lists | `- item` or `* item` | ✅ |
| Numbered lists | `1. item` | ✅ |
| Task lists | `- [x] done` | ✅ |
| Tables | `| col | col |` | ✅ |
| Links | `[text](url)` | ✅ |
| Horizontal rules | `---` or `***` | ✅ |
| Blockquotes | `> quote` | ✅ |

