schroneko/skills

pdf-to-text

PDFファイルからテキストを抽出する。macOS標準のPDFKitを使用し、外部依存なしで動作する。「PDFを読んで」「PDFからテキスト抽出」「PDF の?

First seen Jul 2, 2026

Installation

$ npx skills add schroneko/skills --skill pdf-to-text

Summary

PDFファイルからテキストを抽出する。macOS標準のPDFKitを使用し、外部依存なしで動作する。「PDFを読んで」「PDFからテキスト抽出」「PDF の内容を教えて」「PDFをテキストに起こして」「PDFをテキスト化」などのリクエストで使用する。

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from schroneko/skills · top by installs.

npx skills add schroneko/skills

Browse all from schroneko/skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 1
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,537 B
  • docs SUMMARY.md 334 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 17 installs

SKILL.md

PDF to Text

macOS 標準の PDFKit と Vision framework を使用して PDF からテキストを抽出する。外部依存なし。

使い方

scripts/extract.sh "PDFファイルのパス" [モード] [ページ範囲]

モード

モード 説明
auto PDFKit で抽出し、500 バイト未満または文字化けなら Vision OCR(デフォルト)
pdfkit PDFKit のみ使用(テキストレイヤーがある PDF 向け)
ocr Vision OCR のみ使用(スキャン PDF、画像 PDF、または常に OCR したい場合向け)

ページ範囲(ocr モードのみ)

説明
1-10 1〜10 ページ
5 5 ページのみ
10- 10 ページ〜最後
-5 1〜5 ページ

動作

  1. 指定された PDF からテキストを抽出
  2. PDF と同じディレクトリにキャッシュとして保存(ページ範囲指定時は除く)
  3. 標準出力にテキストを出力

自動モード(auto)の動作

  1. まず PDFKit でテキストレイヤーを抽出
  2. 以下の場合、Vision OCR にフォールバック:

- 抽出結果が 500 バイト未満(スキャン PDF と判断) - 抽出結果に文字化けパターンを検出(CID フォント問題)

  1. Vision framework で並列 OCR 処理

依存関係

なし(すべて macOS 標準機能)

  • PDFKit: macOS 標準
  • Vision framework: macOS 標準(並列処理対応)

キャッシュ

  • 保存先: PDF と同じディレクトリ
  • ファイル名: {PDFファイル名}.txt(抽出方法によらず統一)

複数ファイルの一括処理

scripts/batch.sh "PDFディレクトリ" [並列数]

引数

引数 説明 デフォルト
PDFディレクトリ PDF ファイルが含まれるディレクトリ カレントディレクトリ
並列数 同時処理数 12

出力

  • 各 PDF と同じ場所に .txt ファイルを作成
  • 処理ログを <PDFディレクトリ>/batch-processing.log に保存

ログ形式

[2025-01-05 12:34:56] === PDF Batch Processing Started ===
[2025-01-05 12:34:56] Total PDFs: 86
[2025-01-05 12:34:56] To process: 85
[2025-01-05 12:34:57] OK: ファイル名.pdf (12.3s)
...
[2025-01-05 12:40:00] --- Summary ---
[2025-01-05 12:40:00] Processed: 85
[2025-01-05 12:40:00] Total time: 304.5s

時間計測

単一ファイル処理(extract.sh)も [TIMING] タグで処理時間を stderr に出力する:

[TIMING] PDFKit: 0.368s
[TIMING] Vision OCR: 13.142s
[TIMING] Total: 13.510s

制限事項

  • macOS 専用
  • 日本語・英語に対応
  • パスワード保護された PDF は抽出できない