Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计异常

pdf-readerPDF reader 搜索

Agent Skill

pdf-reader 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

612

周安装

26

GitHub Stars

90

下载量

214
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:pdf-reader(PDF reader 搜索)
来源仓库:https://github.com/espennilsen/pi
仓库路径:skills/pdf-reader
安装命令:
npx skills add https://github.com/espennilsen/pi --skill pdf-reader
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/espennilsen/pi --skill pdf-reader

简介

pdf-reader 提取 PDF 文本与表格内容,支持 pdftotext 与 pdfplumber 两种引擎。

  • 适用于文档分析与结构化数据抽取任务。
  • 可获取元数据、图像与 OCR 扫描件识别结果。
  • 安装命令:npx skills add https://github.com/espennilsen/pi --skill pdf-reader。
  • 使用前请确认 PDF 是否为加密文件或含复杂布局,可能影响提取准确性。

SKILL.md

PDF Reader

Extract content from PDF files using pdftotext (Poppler) for text and pdfplumber (Python) for tables and structured extraction.

Quick Reference

TaskToolCommand
Full textpdftotextpdftotext file.pdf -
Text with layoutpdftotextpdftotext -layout file.pdf -
Specific pagespdftotextpdftotext -f 3 -l 5 file.pdf -
Tablespdfplumberpython3 scripts/extract.py tables file.pdf
Metadatapdfinfopdfinfo file.pdf
Page countpdfinfo`pdfinfo file.pdf \grep Pages`
Imagespdfimagespdfimages -list file.pdf
Fontspdffontspdffonts file.pdf
OCR (scanned PDF)tesseractpython3 scripts/extract.py ocr file.pdf
Smart text + OCRextract.pypython3 scripts/extract.py text file.pdf
Quick surveyextract.pypython3 scripts/extract.py scan file.pdf

Workflow

Step 1: Get the PDF

If the user provides a URL, download it first:

curl -sL "URL" -o /tmp/document.pdf

Verify it's a valid PDF:

file /tmp/document.pdf  # should say "PDF document"
pdfinfo /tmp/document.pdf  # metadata + page count

Step 2: Choose Extraction Method

Plain text (most cases):

pdftotext file.pdf -

This pipes output to stdout. For large PDFs, use page ranges:

pdftotext -f 1 -l 10 file.pdf -    # pages 1-10

Layout-preserving text (columns, formatted docs):

pdftotext -layout file.pdf -

Use -layout when the PDF has multi-column layouts, tables rendered as text, or precise spacing that matters.

Tables (structured data):

python3 scripts/extract.py tables file.pdf

Or inline with pdfplumber:

import pdfplumber

pdf = pdfplumber.open("file.pdf")
for i, page in enumerate(pdf.pages):
    tables = page.extract_tables()
    for table in tables:
        print(f"\n--- Table on page {i+1} ---")
        for row in table:
            print(" | ".join(str(cell or "") for cell in row))
pdf.close()

Metadata only:

pdfinfo file.pdf

Returns: title, author, creator, producer, page count, page size, dates.

Step 3: Handle Large PDFs

For PDFs over ~50 pages, don't dump everything at once:

  1. Get page count: pdfinfo file.pdf | grep Pages
  2. Extract in chunks: pdftotext -f 1 -l 20 file.pdf -
  3. Process chunk, then continue: pdftotext -f 21 -l 40 file.pdf -

For targeted extraction (searching for specific content):

# Extract all text, grep for relevant sections
pdftotext file.pdf - | grep -n -i "keyword"

# Then extract the specific page range
pdftotext -f PAGE -l PAGE file.pdf -

Step 4: Handle Scanned PDFs (OCR)

If pdftotext returns empty or garbled output, the PDF is likely scanned.

Detection:

python3 scripts/extract.py scan file.pdf   # reports scanned pages
pdffonts file.pdf                           # empty = image-based

Smart extraction (auto-fallback):

text mode automatically detects scanned pages and OCRs them:

python3 scripts/extract.py text file.pdf

Pages with selectable text extract normally. Pages without selectable text fall back to OCR via Tesseract. No manual detection needed.

Force OCR on all pages:

python3 scripts/extract.py ocr file.pdf
python3 scripts/extract.py ocr file.pdf --pages 1-5
python3 scripts/extract.py ocr file.pdf --dpi 400        # higher quality
python3 scripts/extract.py ocr file.pdf --lang eng+nor   # multi-language

OCR options:

  • --dpi 300 — resolution for page-to-image conversion (default: 300, higher = slower but better)
  • --lang eng — Tesseract language pack (default: eng). Use + for multiple: eng+nor+deu
  • --pages 1-5 — limit to specific pages (recommended for large PDFs)

Available language packs:

tesseract --list-langs

Install additional languages via Homebrew:

brew install tesseract-lang    # all languages

Step 5: Handle Other Edge Cases

Mixed PDFs (some pages scanned, some not):

Just use text mode — it handles mixed PDFs automatically:

python3 scripts/extract.py text file.pdf

Selectable pages extract instantly, scanned pages get OCR'd. The output is tagged so you know which pages used OCR.

Password-protected PDFs:

pdftotext -upw "password" file.pdf -   # user password
pdftotext -opw "password" file.pdf -   # owner password

Encoding issues (garbled output):

pdftotext -enc UTF-8 file.pdf -

Extract images:

pdfimages -png file.pdf /tmp/images/img   # extracts as PNG
pdfimages -list file.pdf                  # list images without extracting

Decision Tree

Is it a URL? → curl -sL "URL" -o /tmp/doc.pdf
            ↓
Run: python3 scripts/extract.py scan file.pdf
            ↓
All pages have selectable text?
  YES → pdftotext file.pdf -           (fast, simple)
  NO  → python3 scripts/extract.py text file.pdf  (auto OCR fallback)
            ↓
Need tables?
  YES → python3 scripts/extract.py tables file.pdf

Tips

  • Start with scan on unknown PDFs — it reports pages, tables, scanned detection, and a preview
  • pdftotext is fastest for normal PDFs — try it first
  • Use -layout for multi-column documents (academic papers, reports)
  • pdfplumber is better for tables — it understands cell boundaries
  • text mode auto-detects scanned pages and OCRs only those — preferred over raw pdftotext for unknown PDFs
  • ocr mode is for forcing OCR on everything (useful when text extraction gives garbled output despite appearing selectable)
  • Higher --dpi gives better OCR accuracy but is slower (300 is a good default, 400+ for small text)
  • For PDFs from URLs, always download to /tmp/ first — don't pipe curl to tools
  • Large PDF text output may exceed context limits — use --pages to extract in ranges

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.02%
按下载量换算79

Claude

30.57%
按下载量换算65

Cursor

17.08%
按下载量换算37

Gemini CLI

8.41%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills