PDF Splitter Ocr

Description

XSpoonAi Updated 17 repo stars

File contents

Description

Split PDF documents and perform optical character recognition (OCR) for text extraction and searchability. Supports batch processing and text indexing.

Inputs

{
  "pdf_path": "Path to PDF file",
  "action": "split|ocr|extract",
  "pages": "1-5|all"
}

Outputs

{
  "ok": true,
  "data": {
    "text": "Extracted text",
    "pages": 5
  }
}

Usage

Demo Mode

python scripts/main.py --demo

Extract Text

echo '{"pdf_path":"document.pdf","action":"extract"}' | python3 scripts/main.py

Examples

Example 1: OCR PDF

$ echo '{"pdf_path":"document.pdf","action":"ocr","pages":"1-3"}' | python3 scripts/main.py
{
  "ok": true,
  "data": {
    "text": "Extracted text content...",
    "pages": 3
  }
}

Error Handling

When an error occurs, the skill returns:

{
  "ok": false,
  "error": "Error description",
  "details": {
    "pdf_path": "File not found"
  }
}

XSpoonAi/spoon-awesome-skill commit 5a655b00b5

Frequently asked questions

npx get-skill add xspoonai/pdf-splitter-ocr