henryxiao709/dsh-pdf0

@dsh-external/dsh-pdf

无文件大小限制的 PDF 读取插件。通过 pdfjs-dist 提取中英文文本,并针对扫描件或多图页面提供自动 OCR 功能(支持 Windows WinRT OCR 或 Tesseract.js)。

AI 分析

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

包名
@dsh-external/dsh-pdf
版本
0.1.0
许可证
MIT
最近更新
2026年8月16日

安装

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

🧰 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.