Pdf text extractor

From LeoYeAI/openclaw-master-skills · View interactive version

Pdf text extractor is an AI agent skill from the GitHub repository LeoYeAI/openclaw-master-skills. Extract text from PDFs with OCR support. Perfect for digitizing documents, processing invoices, or analyzing content. Zero dependencies required.

How to use this skill

Skill file

PDF-Text-Extractor - Extract Text from PDFs

Vernox Utility Skill - Perfect for document digitization.

Overview

PDF-Text-Extractor is a zero-dependency tool for extracting text content from PDF files. Supports both embedded text extraction (for text-based PDFs) and OCR (for scanned documents).

Features

✅ Text Extraction

✅ OCR Support

✅ Batch Processing

✅ Output Options

✅ Utility Features

Installation

clawhub install pdf-text-extractor

Quick Start

Extract Text from PDF

const result = await extractText({
  pdfPath: './document.pdf',
  options: {
    outputFormat: 'text',
    ocr: true,
    language: 'eng'
  }
});

console.log(result.text);
console.log(`Pages: ${result.pages}`);
console.log(`Words: ${result.wordCount}`);

Batch Extract Multiple PDFs

const results = await extractBatch({
  pdfFiles: [
    './document1.pdf',
    './document2.pdf',
    './document3.pdf'
  ],
  options: {
    outputFormat: 'json',
    ocr: true
  }
});

console.log(`Extracted ${results.length} PDFs`);

Extract with OCR

const result = await extractText({
  pdfPath: './scanned-document.pdf',
  options: {
    ocr: true,
    language: 'eng',
    ocrQuality: 'high'
  }
});

// OCR will be used (scanned document detected)

Tool Functions

`extractText`

Extract text content from a single PDF file.

Parameters:

Returns:

`extractBatch`

Extract text from multiple PDF files at once.

Parameters:

Returns:

`countWords`

Count words in extracted text.

Parameters:

Returns:

`detectLanguage`

Detect the language of extracted text.

Parameters:

Returns:

Use Cases

Document Digitization

Content Analysis

Data Extraction

Text Processing

Performance

Text-Based PDFs

OCR Processing

Technical Details

PDF Parsing

OCR Engine

Dependencies

Error Handling

Invalid PDF

OCR Failure

Memory Issues

Configuration

Edit `config.json`:

{
  "ocr": {
    "enabled": true,
    "defaultLanguage": "eng",
    "quality": "medium",
    "languages": ["eng", "spa", "fra", "deu"]
  },
  "output": {
    "defaultFormat": "text",
    "preserveFormatting": true,
    "includeMetadata": true
  },
  "batch": {
    "maxConcurrent": 3,
    "timeoutSeconds": 30
  }
}

Examples

Extract from Invoice

const invoice = await extractText('./invoice.pdf');
console.log(invoice.text);
// "INVOICE #12345 Date: 2026-02-04..."

Extract from Scanned Contract

const contract = await extractText('./scanned-contract.pdf', {
  ocr: true,
  language: 'eng',
  ocrQuality: 'high'
});
console.log(contract.text);
// "AGREEMENT This contract between..."

Batch Process Documents

const docs = await extractBatch([
  './doc1.pdf',
  './doc2.pdf',
  './doc3.pdf',
  './doc4.pdf'
]);
console.log(`Processed ${docs.successCount}/${docs.results.length} documents`);

Troubleshooting

OCR Not Working

Extraction Returns Empty

Slow Processing

Tips

Best Results

Performance Optimization

Roadmap

License

MIT


Extract text from PDFs. Fast, accurate, zero dependencies. 🔮

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.