extracting-pdf-text

Extract text from PDFs into Markdown for LLM and RAG pipelines.

3|Updated Dec 23, 2025
One-click install
npx skills add https://github.com/boazcstrike/opencode --skill extracting-pdf-text
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: extracting-pdf-text
Source: https://github.com/boazcstrike/opencode/tree/main/skills/extracting-pdf-text
Command: npx skills add https://github.com/boazcstrike/opencode --skill extracting-pdf-text

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill addresses the challenge of converting PDF documents, including text-based, table-heavy, and scanned images, into a format that Large Language Models (LLMs) can effectively process for tasks like Retrieval Augmented Generation (RAG) or in-depth document analysis.

Core Features & Use Cases

  • Versatile Extraction: Supports various PDF types, from simple text to scanned documents requiring OCR.
  • Multiple Tools: Integrates local libraries (PyMuPDF, pdfplumber, pytesseract) and API services (Mistral OCR) for flexible and accurate text extraction.
  • RAG Optimization: Formats extracted text for optimal use in RAG pipelines.
  • Use Case: Automatically extract all textual content from a research paper PDF to feed into an LLM for summarization and question-answering.

Quick Start

Use the extracting-pdf-text skill to extract all text from the attached file 'report.pdf' into 'output.md'.

Frequently Asked Questions about extracting-pdf-text

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

FAQPage Schema
How do I extract text from a scanned PDF for LLM processing?

To extract text from scanned PDFs for LLM processing, you can use OCR tools like pytesseract or the Mistral OCR API to convert image-based documents into machine-readable text suitable for RAG pipelines.

What is the best way to parse PDF tables for Retrieval Augmented Generation?

Parsing PDF tables for Retrieval Augmented Generation is best handled by pdfplumber, which accurately extracts structured table data and formats it for optimal consumption by Large Language Models.

How do I convert a research paper PDF into markdown for document analysis?

Converting a research paper PDF into markdown for document analysis involves extracting text content using local tools like PyMuPDF, then formatting the output into a structured markdown file for LLM summarization and question-answering.

Can I use PyMuPDF and pdfplumber together for text extraction?

Yes, you can use PyMuPDF and pdfplumber together for text extraction, allowing you to handle both standard text-based PDFs and documents with complex tables by leveraging each tool's specific extraction strengths.

Does extracting PDF text for RAG pipelines require an API key?

Extracting PDF text for RAG pipelines does not strictly require an API key, as local libraries like PyMuPDF and pytesseract work offline, but using the Mistral OCR API for high-accuracy scanned document extraction will require one.

Why does text extraction fail on certain image-heavy PDF documents?

Text extraction fails on image-heavy PDF documents because standard libraries cannot read embedded images, requiring OCR via pytesseract or Mistral OCR to successfully process and extract the scanned content.