據 AlphaMoat 統計,截至 2026-09,pdf-ocr-extraction 累計下載 1,853 次、獲 2 個星標,在全部 5,078 個 AI 技能中排名第 4,534 位,在「辦公效率」分類(435 個)中排名第 357 位。
| 平台 | 累計安裝 | 累計下載 | 星標 | 評論 |
|---|---|---|---|---|
| ClawHub ↗ | 45 | 1636 | 2 | - |
| SkillHub ↗ | 224 | 1853 | 2 | — |
各平台的計數口徑不同,統計時間不一致。
適用於缺少原生文字層的掃描版或圖片型 PDF:完全免費、不呼叫第三方 API、無使用限制;原理是把 PDF 頁面渲染為高解析度圖片(scale=2)再執行 OCR。依賴:系統二進位制 tesseract(含 chi_sim/eng 等語言包)與 Python 包 pypdfium2、pytesseract、Pillow;不要在執行時自動 pip install,依賴應由使用者或環境按 metadata 塊預裝。用法:在臨時目錄建立 extract.py(用 PdfDocument 遍歷頁 → bitmap.to_pil() 儲存 /tmp/page_i.png → pytesseract.image_to_string(lang='chi_sim+eng') → os.remove 清理 → 拼接全文),再執行 python3 extract.py /path/to/document.pdf。安全約束:臨時圖片只寫 /tmp/ 且提取後立即清理;不要用 shell 動態下載或安裝語言包,缺特定語言時通知使用者。臨時 OCR 圖片寫入可預測的共享路徑可能洩露文件內容,應改用記憶體 OCR 或私有隨機臨時目錄並在處理後立即刪除;缺語言包或語言選項不匹配時 OCR 質量與覆蓋率會變差,使用前應裝好所需語言包並讓 Tesseract 語言選項與文件一致;執行時安裝依賴會帶來運維與安全不確定性,應在最小許可權環境預裝 Tesseract、語言包、pypdfium2、pytesseract 與 Pillow。
資料釋出於 2026-10-29
以下是根據技能文件生成的示例,不代表實際執行結果。
2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。
| 月份 | 累計下載 | 環比 | 星標 |
|---|---|---|---|
| 2026-09 | 1853 | — | 2 |
| 2026-08 | 1554 | +7.5% | 2 |
| 2026-07 | 1445 | +20.9% | 2 |
| 2026-06 | 1195 | +18.0% | 2 |
| 2026-05 | 1013 | — | 2 |
| 2026-03 | 408 | — | 1 |
以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。
---
name: pdf-ocr-extractor
description: Extract text from image-based or scanned PDFs using Tesseract OCR.
metadata:
{
"openclaw":
{
"emoji": "📄",
"requires": { "bins": ["tesseract", "python3"] },
"install": [
{
"id": "tesseract-ocr",
"kind": "system",
"package": "tesseract",
"bins": ["tesseract"],
"label": "Install Tesseract OCR (requires language packs e.g., tesseract-ocr-chi-sim)"
},
{
"id": "pip-deps",
"kind": "uv",
"package": "pypdfium2 pytesseract Pillow",
"label": "Install Python dependencies (pypdfium2, pytesseract, Pillow)"
}
]
}
}
---
# PDF OCR Extractor
Use this skill to extract text from scanned PDFs or image-based PDFs that lack a native text layer. It's completely free, doesn't utilize third-party APIs, and offers unlimited usage. It renders PDF pages to images and runs optical character recognition (OCR).
## Dependencies
This skill requires:
1. **System Binary**: `tesseract` (along with required language data packs like `chi_sim` or `eng`).
2. **Python Packages**: `pypdfium2`, `pytesseract`, and `Pillow`.
*Note: Do not run automated `pip install` commands at runtime. Rely on the user or the environment to pre-install the dependencies defined in the metadata block.*
## Quick Start
Create a Python script (e.g., `extract.py`) in a temporary directory to handle the extraction safely:
```python
import pypdfium2 as pdfium
import pytesseract
from PIL import Image
import sys
import os
def extract(pdf_path):
doc = pdfium.PdfDocument(pdf_path)
full_text = []
for i, page in enumerate(doc):
# Render page to a high-resolution image
bitmap = page.render(scale=2)
tmp_img = f"/tmp/page_{i}.png"
bitmap.to_pil().save(tmp_img)
# Run OCR (assuming English and Simplified Chinese packs are installed)
text = pytesseract.image_to_string(Image.open(tmp_img), lang='chi_sim+eng')
full_text.append(text)
# Cleanup temporary file
os.remove(tmp_img)
return "\n".join(full_text)
if __name__ == "__main__":
if len(sys.argv) > 1:
print(extract(sys.argv[1]))
```
Then execute the script:
```bash
python3 extract.py /path/to/document.pdf
```
## Security & Sandbox Constraints
- Write temporary images only to `/tmp/` and clean them up immediately after extraction.
- Do not attempt to dynamically download or install language packs via shell commands; notify the user if a specific language is missing.透過 MCP 在騰訊文件裡新建、編輯與管理線上文件的完整操作手冊。
在保留公式、格式和活頁簿結構的前提下建立、檢查或編輯 Excel 檔案。
處理 Word 與 DOCX 文件的作業指南,著重維持樣式、編號與版面。
透過命令列存取 Gmail、日曆、Drive、Contacts、Sheets 與 Docs。
PDF和圖片文字提取 將文件文字、表格與掃描頁識別整理為文字結果。
按主題與風格自動生成 PPT 檔案的技能。
透過 kdocs-cli 操作金山文件雲文件的官方技能。
用自然語言指令改 PDF 指定頁的小工具。
資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。