Atlas / Skills / leoyeai / Pdf Text Extractor

Pdf Text ExtractorSAFE

skills/leoyeai/pdf-text-extractor

🧠 Curated collection of 1209+ best OpenClaw skills — weekly updated by MyClaw.ai

Verdict
SAFE
Grade
B
Trust score
89 /100
Version
—
Hosts
1 documented
License
MIT
Stars
2,160
01

Overview

From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.

Extract text from PDFs with OCR support. Zero external dependencies (except PDF.js).

Quick Start

# Install
clawhub install pdf-text-extractor

# Extract text from PDF
cd ~/.openclaw/skills/pdf-text-extractor
node index.js extractText '{"pdfPath":"./document.pdf","options":{"outputFormat":"text"}}'

Usage Examples

Extract to Text

const result = await extractText({
pdfPath: './invoice.pdf',
options: { outputFormat: 'text' }
});

console.log(result.text);

Extract to JSON with Metadata

const result = await extractText({
pdfPath: './contract.pdf',
options: {
outputFormat: 'json',
includeMetadata: true
}
});

console.log(result.metadata);
console.log(`Words: ${result.wordCount}`);

Batch Process Multiple PDFs

const results = await extractBatch({
pdfFiles: [
'./doc1.pdf',
'./doc2.pdf',
'./doc3.pdf'
]
});

console.log(`Processed ${results.successCount}/${results.results.length} documents`);

Extract with OCR (Scanned Documents)

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

console.log(result.text);

Count Words and Stats

const stats = await countWords({
text: result.text,
options: { countByPage: true }
});

console.log(`Total words: ${stats.wordCount}`);
console.log(`Pages: ${stats.pageCounts.length}`);
console.log(`Avg per page: ${stats.averageWordsPerPage}`);

Detect Language

const lang = await detectLanguage(text);

console.log(`Language: ${lang.languageName}`);
console.log(`Confidence: ${lang.confidence}%`);

Features

  • Text Extraction: Extract text from PDFs without external tools
  • OCR Support: Use Tesseract for scanned documents
  • Batch Processing: Process multiple PDFs at once
  • Multiple Output Formats: Text, JSON, Markdown, HTML
Read from source at commit 4f3b4a2a472eOBSERVED · 2026-10-08
02

Install

Commands as the repository documents them. They are shown, not run.

npm install pdfjs-dist
03

Host compatibility

What the documentation claims. We have not run a compatibility test.

HostStatusNotes
openclawmentioned
04

What it tells the agent

The instruction file, verbatim from the audited commit — this is the text the model reads, and the surface the audit's instruction layer examines. Quoted here so you can judge it without cloning anything.

---
name: pdf-text-extractor
description: Extract text from PDFs with OCR support. Perfect for digitizing documents, processing invoices, or analyzing content. Zero dependencies required.
metadata:
  {
    "openclaw":
      {
        "version": "1.0.0",
        "author": "Vernox",
        "license": "MIT",
        "tags": ["pdf", "ocr", "text", "extraction", "document", "digitization"],
        "category": "tools"
      }
  }
---

# 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
- Extract text from PDFs without external tools
- Support for both text-based and scanned PDFs
- Preserve document structure and formatting
- Fast extraction (milliseconds for text-based)

### ✅ OCR Support
- Use Tesseract.js for scanned documents
- Support multiple languages (English, Spanish, French, German)
- Configurable OCR quality/speed
- Fallback to text extraction when possible

### ✅ Batch Processing
- Process multiple PDFs at once
- Batch extraction for document workflows
- Progress tracking for large files
- Error handling and retry logic

### ✅ Output Options
- Plain text output
- JSON output with metadata
- Markdown conversion
- HTML output (preserving links)

### ✅ Utility Features
- Page-by-page extraction
- Character/word counting
- Language detection
- Metadata extraction (author, title, creation date)

## Installation

```bash
clawhub install pdf-text-extractor
```

## Quick Start

### Extract Text from PDF

```javascript
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

```javascript
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

```javascript
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:**
- `pdfPath` (string, required): Path to PDF file
- `options` (object, optional): Extraction options
  - `outputFormat` (string): 'text' | 'json' | 'markdown' | 'html'
  - `ocr` (boolean): Enable OCR for scanned docs
  - `language` (string): OCR language code ('eng', 'spa', 'fra', 'deu')
  - `preserveFormatting` (boolean): Keep headings/structure
  - `minConfidence` (number): Minimum OCR confidence score (0-100)

**Returns:**
- `text` (string): Extracted text content
- `pages` (number): Number of pages processed
- `wordCount` (number): Total word count
- `charCount` (number): Total character count
- `language` (string): Detected language
- `metadata` (object): PDF metadata (title, author, creation date)
- `method` (string): 'text' or 'ocr' (extraction method)

### `extractBatch`
Extract text from multiple PDF files at once.

**Parameters:**
- `pdfFiles` (array, required): Array of PDF file paths
- `options` (object, optional): Same as extractText

**Returns:**
- `results` (array): Array of extraction results
- `totalPages` (number): Total pages across all PDFs
- `successCount` (number): Successfully extracted
- `failureCount` (number): Failed extractions
- `errors` (array): Error details for failures

### `countWords`
Count words in extracted text.

**Parameters:**
- `text` (string, required): Text to count
- `options` (object, optional):
  - `minWordLength` (number): Minimum characters per word (default: 3)
  - `excludeNumbers` (boolean): Don't count numbers as words
  - `countByPage` (boolean): Return word count per page

**Returns:**
- `wordCount` (number): Total word count
- `charCount` (number): Total character count
- `pageCounts` (array): Word count per page
- `averageWordsPerPage` (number): Average words per page

### `detectLanguage`
Detect the language of extracted text.

**Parameters:**
- `text` (string, required): Text to analyze
- `minConfidence` (number): Minimum confidence for detection

**Returns:**
- `language` (string): Detected language code
- `languageName` (string): Full language name
- `confidence` (number): Confidence score (0-100)

## Use Cases

### Document Digitization
- Convert paper documents to digital text
- Process invoices and receipts
- Digitize contracts and agreements
- Archive physical documents

### Content Analysis
- Extract text for analysis tools
- Prepare content for LLM processing
- Clean up scanned documents
- Parse PDF-based reports

### Data Extraction
- Extract data from PDF reports
- Parse tables from PDFs
- Pull structured data
- Automate document workflows

### Text Processing
- Prepare content for translation
- Clean up OCR output
- Extract specific sections
- Search within PDF content

## Performance

### Text-Based PDFs
- **Speed:** ~100ms for 10-page PDF
- **Accuracy:** 100% (exact text)
- **Memory:** ~10MB for typical document

### OCR Processing
- **Speed:** ~1-3s per page (high quality)
- **Accuracy:** 85-95% (depends on scan quality)
- **Memory:** ~50-100MB peak during OCR

## Technical Details

### PDF Parsing
- Uses native PDF.js library
- Extracts text layer directly (no OCR needed)
- Preserves document structure
- Handles password-protected PDFs

### OCR Engine
- Tesseract.js under the hood
- Supports 100+ languages
- Adjustable quality/speed tradeoff
- Confidence scoring for accuracy

### Dependencies
- **ZERO external dependencies**
- Uses Node.js built-in mo
05

Trust audit

SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.

LayerWhat it checksResult
L0Provenance & inventoryPASS
L1Static analysis of the codeWARN
L2Instruction surface (what it tells the agent)PASS
L3Class-specific surfacePASS
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
none-observed
Network
none-observed
Shell
none-observed
Dependencies
not all pinned
Secrets in source
none-found

Findings (2)

MEDIUMObfuscation / stealth · obf.base64_blob · CWE-506, CWE-94
skills/compdf-conversion-cli/scripts/license.xml:9
<key>k5Ey9KFlkqpj+SDkUw+5ED9lTA3En/qUi0zdrydUCH3kMWTE3Eh65NXnFCaxlY2omY2JHnlEoK7Li7oOEvM7eG5VPdcO/sFlMfoCRdnLYdepJ+uLzYwOWR8W4yQVve/clxVFTVRL4DFleKInGdpAxIbHZT2yi4ADAMENls1N1XSLojRuqXePXDeAT/4Mv4TTx0s
LOWSupply chain · supply.unpinned · CWE-829, CWE-1357
package.json
pdfjs-dist
Why it matters. 1 dependency range(s) float
Fix. pin exact versions or ship a lockfile

Gates applied: no_behavioural_pass.

Audited 2026-10-08 · audit v0.4.1 · source sha 4f3b4a2a472efull audit observations/trust-audit/skill/leoyeai__pdf-text-extractor.json · Report an issue / request a re-scan
06

Audit history

Every audit this skill has had.

DateSourceVerdictGradeScoreChange
2026-10-084f3b4a2a472eSAFEB89first audit
07

Questions

What does the Pdf Text Extractor skill do?

🧠 Curated collection of 1209+ best OpenClaw skills — weekly updated by MyClaw.ai

Is Pdf Text Extractor safe to install?

The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean skill reads B.

What can Pdf Text Extractor access on my machine?

The audit observed no filesystem, network or shell use at all in its source.

Which assistants does Pdf Text Extractor work with?

Its documentation mentions openclaw. That is what the text claims, not a compatibility test we ran.

How current is this page?

The grade is for one exact copy of the source (4f3b4a2a472e), read on 2026-10-08. The repository is watched, and a new audit runs when it changes — this is the first audit.

Advertisement