---
name: pdf-reader-66c23d640f60
description: Extract text, search inside PDFs, and produce summaries.
homepage: "https://pymupdf.readthedocs.io"
metadata:
  {
    "openclaw":
      {
        "emoji": "📄",
        "requires": { "bins": ["python3"], "pip": ["PyMuPDF"] },
        "install":
          [
            {
              "id": "pymupdf",
              "kind": "pip",
              "package": "PyMuPDF",
              "label": "Install PyMuPDF",
            },
          ],
        "version": "1.1.0",
      },
  }
---

# PDF Reader Skill

The `pdf-reader` skill provides functionality to extract text and retrieve metadata from PDF files using PyMuPDF (fitz).

## Tool API

The skill provides two commands:

### extract
Extracts plain text from the specified PDF file.

- **Parameters:**
  - `file_path` (string, required): Path to the PDF file to extract text from.
  - `--max_pages` (integer, optional): Maximum number of pages to extract.

**Usage:**
```bash
python3 skills/pdf-reader/reader.py extract /path/to/document.pdf
python3 skills/pdf-reader/reader.py extract /path/to/document.pdf --max_pages 5
```

**Output:** Plain text content from the PDF.

### metadata
Retrieve metadata about the document.

- **Parameters:**
  - `file_path` (string, required): Path to the PDF file.

**Usage:**
```bash
python3 skills/pdf-reader/reader.py metadata /path/to/document.pdf
```

**Output:** JSON object with PDF metadata including:
- `title`: Document title
- `author`: Document author
- `subject`: Document subject
- `creator`: Application that created the PDF
- `producer`: PDF producer
- `creationDate`: Creation date
- `modDate`: Modification date
- `format`: PDF format version
- `encryption`: Encryption info (if any)

## Implementation Notes

- Uses **PyMuPDF** (imported as `pymupdf`) for fast, reliable PDF processing
- Supports encrypted PDFs (will return error if password required)
- Handles large PDFs efficiently with `max_pages` option
- Returns structured JSON for metadata command

## Example

```bash
# Extract text from first 3 pages
python3 skills/pdf-reader/reader.py extract report.pdf --max_pages 3

# Get document metadata
python3 skills/pdf-reader/reader.py metadata report.pdf
# Output:
# {
#   "title": "Annual Report 2024",
#   "author": "John Doe",
#   "creationDate": "D:20240115120000",
#   ...
# }
```

## Error Handling

- Returns error message if file not found or not a valid PDF
- Returns error if PDF is encrypted and requires password
- Gracefully handles corrupted or malformed PDFs


---
Source attribution: modbender
Original project: https://github.com/modbender/skill-library-mcp/blob/d9c8fe903b5b4e82237dbe8d0df8567783022e18/data/iyeque-pdf-reader/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2025 skill-library-mcp contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: modbender
Original project: https://github.com/modbender/skill-library-mcp/blob/d9c8fe903b5b4e82237dbe8d0df8567783022e18/data/iyeque-pdf-reader/SKILL.md
Attribution basis: Source repository record

Fields of work: Content & Media, Data & Analytics, Education & Research
Roles: Data Analyst, Researcher, Technical Writer
Specialties: API
Tools: Pymupdf
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 73dd12a921c9eea78e635bf9a637156ebd7cddcfc4fb083c1dee63d2009e2da1
