markdown-to-pdf

Convert Markdown documents into PDF files with Playwright or fpdf2 renderers.

5|4|Updated Nov 9, 2025
One-click install
npx skills add https://github.com/takusaotome/claude-skills-library --skill markdown-to-pdf-takusaotome
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: markdown-to-pdf
Source: https://github.com/takusaotome/claude-skills-library/tree/main/skills/markdown-to-pdf
Command: npx skills add https://github.com/takusaotome/claude-skills-library --skill markdown-to-pdf-takusaotome

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires fpdf2, mistune, pyyaml, markdown2, playwright, mermaid-cli, PyMuPDF, Pillow, pymupdf, fonttools, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill converts Markdown documents into professional, shareable PDF files, handling both technical and business styles (including tables and Mermaid diagrams).

Core Features & Use Cases

  • Playwright-based rendering (technical): Converts Markdown to PDF with Mermaid diagram support and optional custom CSS styling.
  • fpdf2-based rendering (business-quality): Generates theme-styled PDFs with optional cover pages, headers/footers, CJK font support, and well-formatted tables (data tables and key-value “info tables”).
  • Mermaid-to-image workflows: Converts Mermaid diagrams into standalone PNG/SVG images that can be embedded or referenced elsewhere.

Quick Start

Convert your Markdown file to a PDF by running the command: python scripts/markdown_to_fpdf.py input.md output.pdf

Frequently Asked Questions about markdown-to-pdf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert Markdown to PDF with Mermaid diagrams and tables?

To convert Markdown to PDF with Mermaid diagrams and tables, use a Playwright HTML/CSS renderer for technical docs or an fpdf2 renderer for business reports. Both handle table rendering, while Playwright specifically supports Mermaid diagrams with strict fallback behavior.

Does Markdown to PDF conversion support CJK fonts and cover pages?

Yes, Markdown to PDF conversion supports CJK fonts and cover pages when using the fpdf2 business renderer. This renderer generates theme-styled PDFs with optional headers, footers, and well-formatted tables for professional reporting workflows.

What is the best way to generate business-quality PDFs from Markdown files?

The best way to generate business-quality PDFs from Markdown is using the fpdf2 renderer, which creates theme-styled documents with cover pages, headers, footers, and formatted tables. It meets deterministic PDF generation requirements for business reporting workflows.

Can I convert Mermaid diagrams to standalone images instead of embedding them in a PDF?

Yes, you can convert Mermaid diagrams to standalone PNG or SVG images using the Mermaid-to-image workflow. This allows you to embed or reference the rendered diagrams elsewhere, independent of the direct Markdown to PDF conversion process.

Do I need Playwright to render Markdown to PDF, or can I use fpdf2?

You do not need Playwright; you can use fpdf2 as an alternative renderer. Playwright is suited for technical documentation with custom CSS and Mermaid support, whereas fpdf2 handles business-quality PDFs with themes, cover pages, and CJK font support.

Why does my Markdown to PDF conversion require a rendering configuration?

Markdown to PDF conversion requires a rendering configuration to define themes, paper size, optional verification, and strict Mermaid handling. This configuration ensures deterministic PDF generation and meets specific formatting requirements for your documents.