bilicen700

pdf-ocr-extraction

オフィス効率化v1.0.3
作者:bilicen700更新日 2026-05-11全 4 バージョン · 最新版の公開日 2026-03-19@clawhub_bilicen700/pdf-ocr-extraction
PDF 処理#OCR#PDF

AlphaMoatによると、2026-09時点でpdf-ocr-extractionのダウンロード数は1,853、スター数は2で、AIスキル全体5,078件中4,534位、オフィス効率化では435件中357位です。

インストール数
224
ダウンロード数
1853
スター数
2
総合順位
#4,534
全体の上位 90% · オフィス効率化の上位 83%
プラットフォームインストール数ダウンロード数スター数コメント
ClawHub ↗4516362-
SkillHub ↗22418532—

プラットフォームごとに集計方法と集計時点が異なります。

このスキルでできること

ネイティブテキスト層のないスキャン版・画像型 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

できること

  • スキャン版・画像型 PDF から編集可能なテキストを抽出
  • サードパーティ API を使わないローカルオフライン OCR
  • PDF 全ページを逐ページ OCR し全文を結合出力

使う場面

  • PDF にネイティブテキスト層がなく直接コピーできないとき
  • Tesseract と Python 依存がローカルに入っており、無料かつ無制限の OCR が必要なとき

プロンプト例

スキルのドキュメントをもとに生成した例であり、実際の実行結果ではありません。

このスキャン PDF から全テキストを抽出して
この画像型 PDF を編集可能なテキストに変換して
この PDF の全ページを OCR して結合テキストを出力して

月次の推移

ダウンロード数1853
292113119692026-03 · ダウンロード数 4082026-05 · ダウンロード数 10132026-06 · ダウンロード数 11952026-07 · ダウンロード数 14452026-08 · ダウンロード数 15542026-09 · ダウンロード数 185326-0326-09
スター数2
1222026-03 · スター数 12026-05 · スター数 22026-06 · スター数 22026-07 · スター数 22026-08 · スター数 22026-09 · スター数 226-0326-09

2026-09 から集計方法を変更し、同名スキルを作者ごとに分けて集計し、全スキルを対象にしました。破線は変更前の月で、変更後のデータとは直接比較せず、変更をまたぐ増減も計算していません。

月ダウンロード数前月比スター数
2026-091853—2
2026-081554+7.5%2
2026-071445+20.9%2
2026-061195+18.0%2
2026-051013—2
2026-03408—1

SKILL.md 原文

作者が公開した元のファイルをテキストのまま表示しています。AlphaMoat による編集や審査はしていません。リンクはクリックできません。コマンドは内容を確認してから実行してください。取得日 2026-10-23。

2.6 KB・ClawHub v1.0.3
---
name: pdf-ocr-extractor
description: Extract text from image-based or scanned PDFs using Tesseract OCR.
metadata:
  {
    "openclaw":
      {
        "emoji": "📄",
        "requires": { "bins": ["tesseract", "python3"] },
        "install":
すべて表示(全 83 行)
          [
            {
              "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.

オフィス効率化の人気スキル

データ月:2026-09 · ダウンロード数、スター数、インストール数は公開スキルレジストリ(ClawHub、SkillHub)から月単位で集計しています。詳しくはデータの方法論をご覧ください。