Pdf Highlight Extractor
/install pdf-highlight-extractor
\r \r
PDF 高亮提取 → Markdown 技能\r
\r
目标\r
\r 从用户提供的 PDF 文件中提取所有高亮(荧光笔)标注文字,汇总后生成带 YAML Front Matter 的 Markdown 文档。\r \r
工作流程\r
\r
Step 1:确认依赖\r
\r
首次使用时,先运行安装脚本确保 pymupdf 已安装:\r
\r
\x3Cpython> scripts/install_deps.py\r
```\r
\r
其中 `\x3Cpython>` 替换为当前环境的 Python 路径(优先使用 managed 版本)。\r
\r
### Step 2:提取高亮(JSON 模式)\r
\r
用 JSON 模式运行提取脚本,获得结构化的高亮数据供后续 AI 处理:\r
\r
```bash\r
\x3Cpython> scripts/extract_highlights.py "\x3Cpdf_path>" --json\r
```\r
\r
- `\x3Cpdf_path>`:用户提供的 PDF 绝对路径\r
- 脚本输出 JSON,包含每条高亮的 `page`(页码)、`color`(颜色名)、`text`(内容)\r
- 如果用户只想提取特定颜色,加 `--color yellow`(支持 yellow/green/red/blue/pink/orange/purple/cyan)\r
\r
### Step 3:AI 生成标题和 Tags\r
\r
分析所有高亮文本的语义,生成:\r
\r
- **title**:3~10 字,概括高亮内容的核心主题,中文优先\r
- **tags**:3~6 个标签,涵盖主题领域、文档类型、关键概念,全部小写,用中文或英文均可\r
\r
### Step 4:生成 Markdown 文件\r
\r
按以下模板在 **PDF 同目录**生成 `\x3Cpdf文件名>_highlights.md`:\r
\r
```markdown\r
---\r
title: "\x3CAI生成的标题>"\r
date: \x3C今日日期 YYYY-MM-DD>\r
tags:\r
- \x3Ctag1>\r
- \x3Ctag2>\r
- ...\r
---\r
\r
# \x3C标题>\r
\r
## 摘录原文\r
\r
### 第 N 页\r
\r
- 高亮内容1\r
- 高亮内容2\r
\r
### 第 M 页\r
\r
- ...\r
\r
---\r
\r
## 内容总结\r
\r
\x3CAI 根据所有高亮内容撰写的 200~400 字综合总结,提炼核心观点、关键数据和重要结论>\r
```\r
\r
### Step 5:输出确认\r
\r
告知用户:\r
- 生成的 Markdown 文件路径\r
- 共提取了多少条高亮、来自多少页\r
- 简要展示 YAML Front Matter 内容\r
\r
## 注意事项\r
\r
- 若脚本报告「未找到任何高亮标注」,可能是 PDF 使用了图片扫描而非文字型高亮,或高亮格式为手写/非标准注释;此时如实告知用户\r
- 若 PDF 路径含中文或空格,确保用双引号包裹路径\r
- 总结部分需真正阅读所有摘录内容后撰写,不能只复述标题\r
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install pdf-highlight-extractor - After installation, invoke the skill by name or use
/pdf-highlight-extractor - Provide required inputs per the skill's parameter spec and get structured output
What is Pdf Highlight Extractor?
识别用户发来的 PDF 文档中的高亮标注内容(荧光笔标记),提取所有高亮文字, 汇总后生成一个带 YAML Front Matter(title、date、tags 三件套)的 Markdown 文件。 title 和 tags 由 AI 根据内容语义自动生成;Markdown 包含「摘录原文」和「内容总结」两部... It is an AI Agent Skill for Claude Code / OpenClaw, with 48 downloads so far.
How do I install Pdf Highlight Extractor?
Run "/install pdf-highlight-extractor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Pdf Highlight Extractor free?
Yes, Pdf Highlight Extractor is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Pdf Highlight Extractor support?
Pdf Highlight Extractor is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Pdf Highlight Extractor?
It is built and maintained by zhengbin1973 (@zhengbin1973); the current version is v1.0.0.