微算力 · API 导航与自营网关
API 接入 EN
未登录登录
📄

一站式 PDF 命令行工具箱

Pdf Poppler Utils · v1.0.0
办公 安全 A 级 作者 xlionjuan 公开目录收录
1.1k 下载 1 安装 3.9k 收藏 20 浏览

简介

开源 PDF 工具集,支持文本/图片提取、合并拆分、格式转换、数字签名验证等十余种核心操作,适合自动化批处理场景。

原始描述

A collection of PDF manipulation tools from the poppler-utils package. Use when working with PDF files - extracting text, images, metadata, splitting, mergin...

通过你的 Agent 添加

安装目录:pdf-poppler-utils/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/pdf-poppler-utils/
Codex CLI~/.codex/skills/pdf-poppler-utils/
DeepSeek Harness~/.agents/skills/pdf-poppler-utils/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

pdf-poppler-utils 是基于 Poppler 项目的命令行工具集,提供 13 个专用工具覆盖 PDF 全生命周期处理:

  • 信息提取:pdfinfo 获取元数据、pdffonts 分析字体
  • 内容提取:pdftotext 提取纯文本、pdfimages 导出图片、pdfdetach 提取附件
  • 文档拆分合并:pdfseparate 按页拆分、pdfunite 多文件合并
  • 格式转换:pdftohtml 转 HTML、pdftoppm/pdftocairo 转图片、支持 PNG/JPEG/TIFF/SVG 等
  • 安全功能:pdfsig 验证数字签名、pdfattach 添加附件

所有工具遵循统一调用范式 tool [options] input.pdf [output],支持 - 作为 stdin/stdout 管道符,便于脚本集成。

显著优点

  1. 开源可靠:Poppler 项目源自 xpdf,是 Linux 发行版标准组件,协议宽松(GPL/部分 BSD)
  2. 功能全面:单一安装包覆盖 90% 以上的日常 PDF 处理需求,无需多工具切换
  3. 批处理友好:纯 CLI 设计,exit code 规范(0/1/2/3/99),易于 CI/CD 和自动化脚本集成
  4. 跨平台:通过 Homebrew 支持 macOS,原生支持 Linux/Windows

潜在缺点与局限性

  • 依赖冲突风险:Homebrew 安装时会引入 curl 依赖,可能与系统已安装的 curl 产生 SSL 证书验证冲突,需手动 brew unlink curl
  • 无 GUI 交互:不支持可视化预览,复杂排版转换需人工校验
  • 加密 PDF 受限:仅支持标准密码保护,部分高级 DRM 无法处理
  • macOS 安装前置:必须预先安装 Homebrew,对无管理员权限环境不友好

适合人群

  • 开发者/运维工程师:需要自动化 PDF 处理流水线
  • 数据分析师:批量提取文本/图片进行 NLP 或 CV 预处理
  • 学术研究者:管理大量文献,需元数据批量整理
  • 隐私敏感用户:本地离线处理,避免上传云端

常规风险

  • 权限操作:brew unlink curl 涉及系统级包管理,建议人工确认后执行
  • 密码处理:命令行传入 -opw/-upw 可能被 shell history 记录,敏感文档建议配合环境变量或交互式输入
  • 输出覆盖:工具默认覆盖同名输出文件,批处理脚本需自行实现备份逻辑
  • 格式兼容性:旧版 PDF 或非标实现可能出现解析异常,关键文档建议转换后人工抽查

技能正文


name: pdf-poppler-utils version: 1.0.0 description: A collection of PDF manipulation tools from the poppler-utils package. Use when working with PDF files - extracting text, images, metadata, splitting, merging, converting to other formats, or managing attachments. metadata: { "openclaw": { "emoji": "📄", "requires": { "bins": ["pdfinfo", "pdftotext", "pdffonts", "pdfimages", "pdfdetach", "pdfseparate", "pdfunite", "pdfsig", "pdftohtml", "pdftoppm", "pdftocairo", "pdftops", "pdfattach"] }, "install": [ { "id": "brew", "kind": "brew", "formula": "poppler", "label": "Install poppler (brew)", }, ] } }

pdf-poppler-utils Skill

A collection of PDF manipulation tools from the poppler-utils package.

Installation

Prerequisites

Install Poppler

brew install poppler

⚠️ Important Warning About curl

The poppler Homebrew package has curl as a dependency. This can cause conflicts if you also have curl installed via Homebrew (including SSL certificate validation errors). Use the system curl directly or consider alternative approaches.

Before using poppler, it is strongly recommended to unlink the Homebrew installed curl:

brew unlink curl -v

⚠️ Please ask for human permission before executing brew unlink curl -v. If the human is unsure, recommend executing it (to resolve the potential conflict).


When to Use Which Tool

Tool Use Case
pdfinfo Get detailed metadata and information about a PDF
pdftotext Extract text content from a PDF
pdffonts Analyze font usage in a PDF
pdfimages Extract images embedded in a PDF
pdfdetach Extract attachments from a PDF
pdfseparate Split a multi-page PDF into individual pages
pdfunite Merge multiple PDFs into one
pdfsig Verify digital signatures in a PDF
pdftohtml Convert PDF to HTML
pdftoppm Convert PDF pages to image formats (PNG, PPM)
pdftocairo Convert PDF to Cairo image formats (PNG, JPEG, TIFF, PDF, SVG)
pdfattach Attach files to a PDF

Quick Reference

View PDF Information

pdfinfo document.pdf

Extract Text

pdftotext document.pdf output.txt
pdftotext document.pdf - | less  # Stream to stdout

Extract Images

pdfimages -png document.pdf image_prefix

Split PDF

pdfseparate document.pdf page_%03d.pdf

Merge PDFs

pdfunite file1.pdf file2.pdf file3.pdf merged.pdf

Convert to HTML

pdftohtml document.pdf output.html

Convert to Images

pdftoppm -png -r 300 document.pdf output_prefix

Tool Details

See individual documentation files in the tools/ folder for detailed usage:


Common Options

Many tools share common options:

Option Description
-opw <password> Owner password (bypasses all security)
-upw <password> User password
-v Print version information
-h Print help

Notes

  • All tools follow the convention: tool [options] input.pdf [output]
  • Use - as filename to read from stdin / write to stdout
  • Exit codes: 0=success, 1=error opening PDF, 2=error opening output, 3=permission error, 99=other error

Reference: Debian manpages

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

pdfdocument-processingcliautomationfile-conversiontext-extractionimage-extractionopen-source

同类 Skill