henryxiao709/dsh-pdf0

@dsh-external/dsh-pdf

A DeepSeek Harness (DSH) plugin that reads PDF files of any size (no 64KB limit): full Unicode text extraction (Chinese/English) via pdfjs-dist, with automatic OCR for scanned or image-heavy pages (Windows WinRT OCR zh-Hans-CN + en-US, or optional tesseract.js).

AI 分析

核心用于突破大文件限制,实现高质量的 PDF 文本提取与 OCR 识别。适合需要处理超大 PDF、扫描版学术论文或图表密集型文档的分析任务。

パッケージ
@dsh-external/dsh-pdf
バージョン
0.1.0
ライセンス
MIT
最終更新
2026/08/16

インストール

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:henryxiao709/dsh-pdf

ドキュメント

README 全文を読む ↗

🧰 Usage

read_pdf file_path=... [pages="1-3"] [mode=auto|text|ocr] [ocrEngine=auto|windows|tesseract] [maxCharsPerPage=20000]

Example result:

{
  "path": ".../test.pdf",
  "totalPages": 7,
  "mode": "auto",
  "pages": [
    { "number": 1, "text": "test… [OCR] test…", "source": "mixed", "chars": 163 },
    { "number": 2, "text": "1 test)…", "source": "text", "chars": 876 }
  ],
  "engines": ["windows: ok", "tesseract: unavailable (no traineddata)"],
  "warnings": []
}

Each page reports source: text (text layer only), ocr (OCR only), or mixed (both).

⚙️ Configuration

The plugin registers a dsh-pdf settings section (host namespace + a settings-UI card): every knob below is adjustable live in the DSH settings UI (Settings → Plugins → dsh-pdf); changes apply immediately and clear the result cache. The same keys can be set in cordis.patch.yml as the composition base:

KeyDefaultDescription
maxFileBytes209715200byte cap per PDF read
readLimitPages50max pages processed per call
ocrMinChars120pages with fewer text-layer chars get OCR'd in auto mode
ocrScale2render scale for OCR (2 ≈ 144 DPI)
ocrEngineautoauto / windows / tesseract
ocrTimeoutMs60000per-page OCR timeout
maxCharsPerPage20000per-page character cap in results
cacheEntries4result cache entries
cacheDir%TEMP%/dsh-pdfscratch dir for the OCR script and temp images

Settings UI: the plugin registers a dsh-pdf settings section — all keys above are adjustable live in the DSH settings UI (Settings → Plugins → dsh-pdf); changes apply immediately and clear the result cache. The cordis.patch.yml values act as the composition base.