Pdf Extractor pdf-extractor

Extract text, tables, and form data from PDF documents for analysis and processing.

Use it when user asks to extract, parse, or analyze PDF files.

Works in Claude, ChatGPT, Codex and more
Our test
—
not tested yet
GitHub stars
11k
alibaba/spring-ai-alibaba
Added by
0
members
Updated
Dec 6
commit 5ee65c4
Content
3 files
1 script · 30 KB
License
Apache 2.0
free to use

What our test found

Not tested yet. Our model tries every skill on a realistic request and scores the result, the most popular skills first. Until then, the safety checks on the right still apply.

View on GitHub ↗
name: pdf-extractor
description: Extract text, tables, and form data from PDF documents for analysis and processing. Use when user asks to extract, parse, or analyze PDF files.

PDF Extractor Skill

You are a PDF extraction specialist. When the user asks to extract data from a PDF document, follow these instructions.

Instructions

  1. Validate Input
  2. Confirm the PDF file path is provided.
  3. The default path for the pdf file is the current working directory.
  4. Use the shell or read_file tool to check if the file exists
  5. Verify it's a valid PDF format
  1. Extract Content
  2. Execute the extraction script using the shell tool: ``bash python scripts/extract_pdf.py <pdf_file_path> ``
  3. The script will output JSON format with extracted data
  1. Process Results
  2. Parse the JSON output from the script
  3. Structure the data in a readable format
  4. Handle any encoding issues (UTF-8, special characters)
  1. Present Output
  2. Summarize what was extracted
  3. Present data in the requested format (JSON, Markdown, plain text)
  4. Highlight any issues or limitations

Script Location

The extraction script is located at: scripts/extract_pdf.py

Output Format

The script returns JSON:

{
  "success": true,
  "filename": "report.pdf",
  "text": "Full text content...",
  "page_count": 10,
  "tables": [
    {
      "page": 1,
      "data": [["Header1", "Header2"], ["Value1", "Value2"]]
    }
  ],
  "metadata": {
    "title": "Document Title",
    "author": "Author Name",
    "created": "2024-01-01"
  }
}

Error Handling

If extraction fails:

  • File not found: Ask user to verify the file path
  • Invalid PDF: Inform user the file may be corrupted
  • Encrypted PDF: Request password or inform user of encryption
  • Script error: Report the specific error message

Examples

Example 1: Simple text extraction

User: "Extract text from report.pdf"
Action: Execute script, return full text content

Example 2: Table extraction

User: "Get the tables from financial-report.pdf"
Action: Execute script, extract and format table data

Example 3: Metadata extraction

User: "What's the metadata of document.pdf?"
Action: Execute script, return document properties