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"
}
}