convert-pdf-to-md

Convert PDF documents into Markdown files with extracted embedded images.

38.5k|4.9k|Updated Jun 11, 2025
One-click install
npx skills add https://github.com/github/awesome-copilot --skill convert-pdf-to-md
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convert-pdf-to-md
Source: https://github.com/github/awesome-copilot/tree/main/skills/convert-pdf-to-md
Command: npx skills add https://github.com/github/awesome-copilot --skill convert-pdf-to-md

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires markitdown[pdf], pymupdf, and includes scripts (resource) and references (resource) components.

What problem does it solve?

PDF files are layout-oriented and cannot be reliably read as plain text, making it hard to analyze, summarize, or extract data from them. This Skill converts PDFs into clean Markdown so their contents can be searched, summarized, and processed by an AI agent.

Core Features & Use Cases

  • PDF to Markdown Conversion: Uses Microsoft's MarkItDown library to extract text and tables from any .pdf file into a structured Markdown document.
  • Embedded Image Extraction: Uses PyMuPDF to pull real embedded images out of each page, deduplicates them, and appends them under a per-page "Extracted Images" section.
  • Batch and Recursive Processing: Converts a single PDF or an entire folder of PDFs, with optional recursive subdirectory traversal and per-document output folders.
  • Use Case: A user drops a folder of quarterly PDF reports and asks for a summary of each one; the Skill converts every PDF to Markdown first, then the agent reads the Markdown to produce the summaries.

Quick Start

Ask the agent to convert the PDF file at a given path to Markdown, for example: "Convert C:\reports\annual-report.pdf to Markdown so you can summarize it."

Frequently Asked Questions about convert-pdf-to-md

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

FAQPage Schema
How do I convert a PDF file to Markdown in Python?

Run the bundled script with the PDF path: python scripts/convert_pdf_to_md.py "path/to/document.pdf". It uses MarkItDown to extract text and tables into a .md file and PyMuPDF to save embedded images into an img folder next to the output.

How do I batch convert a folder of PDF files to Markdown?

Pass the folder path instead of a file: python scripts/convert_pdf_to_md.py "path/to/folder". Add --recursive to include subfolders, and use -o to collect all generated output folders under a separate parent directory.

Does MarkItDown extract images from PDF files?

No, MarkItDown's PDF converter extracts only text and tables and ignores embedded images entirely. This Skill's script separately extracts images with PyMuPDF from both XObject and inline image sources, deduplicates them by hash, and appends them under an Extracted Images section.

Why is the Markdown output empty for my scanned PDF?

Scanned or image-only PDFs have no embedded text layer, and MarkItDown does not perform OCR, so the text body comes out empty or near-empty. The page images are still extracted and can be viewed, but OCR-based tools would be needed for text.

What dependencies are required to convert PDF to Markdown?

You need Python 3.10 or newer, plus the markitdown[pdf] and pymupdf packages, installable via python -m pip install -r scripts/requirements.txt. The script exits with code 2 and a setup pointer if either dependency is missing.