Skip to content
Back to skills

Markdown To Pdf

ASecurity

Convert a markdown file to PDF using mistune + reportlab. Use when the user wants to convert a .md file to PDF, or when another skill needs to produce a PDF from markdown output.

  • 426 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 26, 2026
toolspythonbash

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 2 files and shows the line behind each finding

Scanned November 29, 2026

npx -y skills add staskh/trading_skills --skill markdown-to-pdf --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Markdown To Pdf?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Markdown To Pdf
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/staskh-markdown-to-pdf/badge)](https://www.skillsdirectory.com/skills/staskh-markdown-to-pdf)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: markdown-to-pdf
description: Convert a markdown file to PDF using mistune + reportlab. Use when the user wants to convert a .md file to PDF, or when another skill needs to produce a PDF from markdown output.
user_invocable: true
arguments:
  - name: file
    description: Path to the input markdown file
    required: true
  - name: output
    description: Output PDF path. Defaults to same directory and basename as the input file.
    required: false
dependencies: ["trading-skills"]
---

# Markdown to PDF Converter

Converts a markdown file to a professionally formatted PDF. Pure Python — no system tools required.

## Dependencies

Requires two Python packages (already in `pyproject.toml`):

```
mistune>=3.2
reportlab>=4.0
```

Install with: `uv sync` (or `pip install mistune reportlab`)

## Instructions

```bash
uv run python .claude/skills/markdown-to-pdf/scripts/markdown_to_pdf.py <input.md> [output.pdf]
```

- `input.md` — path to the markdown file (required)
- `output.pdf` — output path (optional; defaults to same directory and basename as input)

## Output

The script returns JSON with:
- `success` — `true` or `false`
- `input` — resolved absolute path of the input file
- `output` — resolved absolute path of the generated PDF
- `error` — error message if `success` is `false`
- `generated_at` — NY timezone timestamp
- `data_delay` — always `"n/a"` (the converter reads no market data; the report states its own delay)

After conversion, tell the user the output PDF path.

## Examples

```bash
# Convert sandbox/report.md → sandbox/report.pdf (default output)
uv run python .claude/skills/markdown-to-pdf/scripts/markdown_to_pdf.py sandbox/report.md

# Explicit output path
uv run python .claude/skills/markdown-to-pdf/scripts/markdown_to_pdf.py sandbox/report.md sandbox/2026-05-20_1430_AAPL_Report.pdf
```

## Supported Markdown

- Headings (H1–H3)
- Paragraphs, bold, italic
- Tables (pipe syntax)
- Fenced code blocks
- Unordered and ordered lists
- Images: `![alt](path)` with a local JPG or PNG, relative to the markdown file or absolute.
  Each is scaled down to fit the page width and three quarters of its height, keeping its
  aspect ratio. A missing file or a remote URL shows `[image: alt]` instead.

Files in this skill

  • SKILL.md1.9 KB
  • scripts/markdown_to_pdf.py17.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.