pdf-text
Extract selectable text from a PDF with pdftotext. Use when an agent needs the text layer of a PDF file.
来源信息
- 仓库
- oidsdev/honeypot
- 最近来源活动
- 2026年10月9日 14:25
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 0
- 分支
- 1
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
文件资源管理器
2 个文件正在显示 SKILL.md
SKILL.md
来源说明 · 只读预览- name
- pdf-text
- description
- Extract selectable text from a PDF with pdftotext. Use when an agent needs the text layer of a PDF file.
# PDF text
Pull the text layer out of a PDF with Poppler's `pdftotext`. The result is plain text on stdout or in a file you name.
## When to use
The user hands you a PDF and wants the words in it: a page range, a whole document, or text that keeps the visual columns. This skill stops when the file has no text layer.
## Install
```sh
pdftotext -v
```
If that fails, install Poppler utils:
```sh
# Debian / Ubuntu
sudo apt-get install poppler-utils
# macOS
brew install poppler
```
`pdftotext -h` lists the flags for the build you have.
## Commands
Write the text to stdout. The second argument `-` means stdout. `-layout` keeps the columns where they were on the page. `-nopgbrk` leaves out the form-feed between pages.
```sh
pdftotext -layout -nopgbrk report.pdf -
```
Limit the range. Pages are numbered from 1.
```sh
pdftotext -f 1 -l 3 -layout report.pdf pages.txt
```
Check the output. A text layer comes back as words. An empty file means the pages are images.
```sh
wc -c pages.txt
```
## Gotchas
- `pdftotext` reads the embedded text layer. A scanned page with no text layer produces an empty result. Optical character recognition is a different tool.
- `-layout` is the right default for multi-column pages. `-raw` follows the content stream and is no longer the recommended mode.
- An encrypted file makes `pdftotext` exit with an error. Stop and ask the user. Do not guess passwords.
- Page numbers start at 1. `-f` and `-l` are inclusive.
---
Also on Honeypot — a free, open index of skills for AI agents: https://honeypot-e6c.pages.dev
[](https://honeypot-e6c.pages.dev)
在 GitHub 查看