# Convert Md To PDF

> Convert Markdown files with Mermaid diagrams to styled PDF. Use when user wants to export/convert markdown to PDF, generate PDF documentation, or create printable documents.

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

---


# Convert Markdown to PDF

Convert markdown files to professionally styled PDFs with Mermaid diagram support.

## Usage

```bash
python ${CLAUDE_PLUGIN_ROOT}/skills/convert-md-to-pdf/scripts/converter.py <input.md> [output.pdf] [--style=STYLE]
```

**Note**: The converter.py script automatically handles TMPDIR overrides to avoid `/tmp/claude` permission issues.

## Available Styles

Check `${CLAUDE_PLUGIN_ROOT}/skills/convert-md-to-pdf/styles/` for options:
- `default` - Clean sans-serif, professional
- `modern` - Bold headers, accent colors
- `minimal` - Serif font, whitespace
- `report` - Formal corporate style

## First Run

**Install dependencies** via `install-dependency` skill:

1. **Python packages**: Use `install-dependency` to install from `${CLAUDE_PLUGIN_ROOT}/skills/convert-md-to-pdf/requirements.txt`
2. **Mermaid CLI**: Use `install-dependency` for `@mermaid-js/mermaid-cli`

**Note**: The `install-dependency` skill automatically sets up local TMPDIR to avoid permission conflicts.

**Linux setup** (Ubuntu 23.10+ or AppArmor systems):

Create `puppeteer-config.json` in your project root:
```json
{
  "args": ["--no-sandbox", "--disable-setuid-sandbox"]
}
```
This allows Puppeteer (used by Mermaid) to launch Chrome for diagram rendering.

## Adding Styles

Create `.css` file in `${CLAUDE_PLUGIN_ROOT}/skills/convert-md-to-pdf/styles/` directory.

