← Back to Skills Marketplace
youmu88

Document Processor

by youmu88 · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
774
Downloads
0
Stars
6
Active Installs
1
Versions
Install in OpenClaw
/install document-processor
Description
PDF和Word文档处理技能,支持PDF-Word相互转换、页面提取、去水印、合并拆分等操作
README (SKILL.md)

文档处理技能 📄

专业的PDF和Word文档处理工具集,支持多种文档格式转换和编辑操作。

功能特性

1. PDF处理

  • ✅ PDF页面提取(提取指定页面生成新PDF)
  • ✅ PDF转Word(保留格式)
  • ✅ PDF合并/拆分
  • ✅ PDF去水印
  • ✅ PDF压缩优化
  • ✅ PDF添加水印/页眉页脚
  • ✅ OCR页码识别(识别扫描件PDF中的页码)

2. Word处理

  • ✅ Word转PDF
  • ✅ Word文档合并
  • ✅ Word内容提取
  • ✅ Word格式清理

3. OCR功能

  • ✅ 扫描件PDF文字识别
  • ✅ 多语言支持(中英文等)
  • ✅ 页码自动识别和映射
  • ✅ 批量OCR处理

4. 其他功能

  • ✅ 图片提取(从PDF中提取图片)
  • ✅ 批量处理(处理多个文件)

工具依赖

本技能需要以下Python库:

  • PyPDF2 - PDF处理
  • python-docx - Word文档处理
  • pdf2docx - PDF转Word
  • Pillow - 图片处理
  • pdfplumber - 高级PDF处理

安装命令:

pip install PyPDF2 python-docx pdf2docx pillow pdfplumber

使用示例

1. PDF页面提取

# 提取第14-29页
python3 pdf_extractor.py "input.pdf" "output_pages_14-29.pdf" -s 14 -e 29

# 提取特定页面
python3 pdf_extractor.py "input.pdf" "output_specific.pdf" -p "1,3,5-7,10"

2. PDF转Word

python3 pdf_to_word.py "document.pdf" "document.docx"

3. Word转PDF

python3 word_to_pdf.py "document.docx" "document.pdf"

4. PDF去水印

python3 remove_watermark.py "input.pdf" "output_no_watermark.pdf"

5. 批量PDF转Word

python3 batch_pdf_to_word.py "/path/to/pdf/folder" "/path/to/output/folder"

脚本文件

本技能包含以下Python脚本:

核心脚本

  1. pdf_extractor.py - PDF页面提取工具
  2. pdf_to_word.py - PDF转Word工具
  3. word_to_pdf.py - Word转PDF工具
  4. pdf_ocr.py - PDF OCR和页码识别工具
  5. remove_watermark.py - PDF去水印工具
  6. pdf_merger.py - PDF合并工具
  7. pdf_splitter.py - PDF拆分工具

实用工具

  1. batch_processor.py - 批量处理工具
  2. pdf_compressor.py - PDF压缩工具
  3. image_extractor.py - 图片提取工具
  4. install_dependencies.py - 依赖安装工具
  5. test_skill.py - 技能测试工具

使用指南

当用户需要处理文档时:

  1. 识别需求:确定用户需要什么功能(转换、提取、编辑等)
  2. 检查依赖:确保所需Python库已安装
  3. 选择脚本:根据需求选择合适的脚本
  4. 执行操作:运行相应的Python脚本
  5. 验证结果:检查输出文件是否满足要求

高级功能

OCR页码识别

# 分析PDF页码结构
python3 pdf_ocr.py analyze "input.pdf" --start 1 --end 50 --language chi_sim+eng

# 根据标注页码提取页面
python3 pdf_ocr.py extract "input.pdf" "output.pdf" --start-label 14 --end-label 29 --language chi_sim+eng

自定义水印

# 添加文本水印
python3 add_watermark.py "input.pdf" "output.pdf" --text "CONFIDENTIAL" --position "center"

# 添加图片水印
python3 add_watermark.py "input.pdf" "output.pdf" --image "watermark.png" --opacity 0.3

批量处理

# 批量转换文件夹内所有PDF为Word
python3 batch_processor.py --input-dir "./pdfs" --output-dir "./docs" --operation "pdf2word"

# 批量提取所有PDF的封面
python3 batch_processor.py --input-dir "./pdfs" --output-dir "./covers" --operation "extract" --pages "1"

错误处理

  • 文件不存在时提供清晰错误信息
  • 格式不支持时建议转换方法
  • 权限问题提示解决方案
  • 内存不足时建议分批处理

性能优化

  • 大文件处理时显示进度条
  • 支持多线程批量处理
  • 提供压缩选项减少文件大小
  • 缓存中间结果避免重复处理

安全注意事项

  • 验证输入文件格式
  • 限制文件大小防止内存溢出
  • 清理临时文件
  • 不处理加密或受保护的PDF
  • 用户确认后再执行删除操作

技能维护者:文档处理团队
最后更新:2026-03-01
版本:1.0.0
状态:✅ 生产就绪

Usage Guidance
要点与建议: 1) 不一致性:SKILL.md/README 列出的多个脚本/功能(去水印、合并/拆分、batch_processor、add_watermark 等)在发布包里缺失——这意味着实际能力不如文档所述,或作者未完整打包。不要假定所有列出功能可用。 2) 在隔离环境中验证:在系统全局运行安装脚本或直接把这些脚本用于敏感文档前,请在虚拟环境或容器中测试(python venv / Docker)。避免在生产主机上直接运行 pip install。 3) 检查并安装系统依赖:若要使用 OCR 功能,必须在宿主机安装 Tesseract OCR(二进制),并安装 pdf2image/pytesseract;这些是系统级依赖,SKILL.md 已提示但注册元数据未声明。 4) 临时文件和隐私:pdf_ocr.py 会创建临时目录并将页面图片与部分 OCR 文本写入其中(save_results 写入前500字符)。确认临时目录是否被清理或手动删除以防止敏感数据残留。 5) 审核代码与缺失功能:如果你需要那些在文档中列出的额外功能(去水印、合并/拆分、批量工具等),要求维护者提供缺失脚本或查看仓库完整源码。若仅需要提取/转换/OCR 的核心功能,现有脚本可在本地验证运行。 6) 安全操作建议:在运行 install_dependencies.py 时使用 --check 首先检测缺失包;用虚拟环境并以非特权用户执行;查看 install_dependencies.py 中的 pip 命令输出,避免意外安装来自替代索引的包。 总体建议:该技能不是明显的恶意软件,但存在文档与实际代码不匹配和系统依赖未声明的问题——把它视作“未充分打包的第三方工具”,在隔离/受控环境中进一步验证并与维护者确认缺失脚本后再在生产环境使用。
Capability Analysis
Type: OpenClaw Skill Name: document-processor Version: 1.0.0 The skill is classified as suspicious due to the presence of vulnerability patterns. The `install_dependencies.py` script uses `subprocess.run(cmd, shell=True)` for `pip install` commands. While the package names are currently hardcoded, the `shell=True` argument creates a shell injection vulnerability pattern if the `dep` variable were ever sourced from untrusted input. Additionally, the `word_to_pdf.py` script, particularly on Windows, directly interacts with Microsoft Word via COM objects (`comtypes`, `win32com`). This exposes the system to potential vulnerabilities within the Microsoft Word application itself when processing untrusted Word documents, creating a significant attack surface for document-based exploits. These are high-risk operations and vulnerability patterns, not direct evidence of malicious intent.
Capability Assessment
Purpose & Capability
SKILL.md/README 宣称很多功能(例如 remove_watermark.py、pdf_merger.py、pdf_splitter.py、batch_processor.py、add_watermark.py 等)以及“合并/拆分/去水印/压缩”等多项工具,但清单/文件清单实际只包含:install_dependencies.py、pdf_extractor.py、pdf_ocr.py、pdf_to_word.py、word_to_pdf.py、test_skill.py、README.md、SKILL.md。也就是说文档中声明的多数脚本并未随包提供,能力声明与实际代码不一致——这是不合比例或不完整打包的信号。
Instruction Scope
SKILL.md 指导代理在本地运行 Python 脚本并读写文件(tools: exec, read, write, edit),脚本本身也只在本地对文件执行处理、OCR、写入临时目录并保存结果。没有发现将数据发送到外部网络或要求读取系统凭证的指令。不过 pdf_ocr.py 会在临时目录保存图片和 OCR 文本(save_results 会写入 temp_dir),有可能留下敏感临时文件;SKILL.md/脚本没有自动清理所有情况下的临时结果(cleanup 有实现但输出保存步骤会留下文件直到 cleanup 被调用)。
Install Mechanism
技能没有 registry install spec(instruction-only),但包中包含 install_dependencies.py 用于通过 pip 安装依赖。该脚本使用 subprocess.run 调用 pip(使用 shell=True),安装源为 PyPI 风格的包名(没有从不可信 URL 下载或解压任意归档),总体安装路径可追溯且风险较低。但运行该脚本会在运行环境中执行 pip install,建议使用虚拟环境或容器,避免全局安装。
Credentials
技能未要求任何环境变量或凭据,这与其本地文件处理功能一致。但 pdf_ocr.py 实际依赖外部二进制 Tesseract 和 python 库 pdf2image/pytesseract(SKILL.md 提到需要用户另行安装 tesseract 软件),这一系统级依赖没有在 registry 的 'required binaries' 中声明;用户需在宿主系统安装 Tesseract(或在受控环境中忽略 OCR 功能)。总体上没有发现不相关或过度的凭据请求。
Persistence & Privilege
技能未请求常驻(always)或特殊平台权限;默认允许模型调用(正常)。脚本会读写用户提供的文件和在临时目录写入调试/ OCR 结果,这是本地文档处理类技能的预期行为。
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install document-processor
  3. After installation, invoke the skill by name or use /document-processor
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of document-processor skill, providing comprehensive PDF and Word document processing tools. - Supports PDF-Word mutual conversion, page extraction, watermark removal, merge/split, and image extraction. - Includes batch processing, OCR (Chinese/English), and advanced document editing features. - Provides command-line scripts for core and utility operations. - Lists required Python dependencies and usage examples. - Adds detailed usage guidance, error handling suggestions, performance optimizations, and security notes.
Metadata
Slug document-processor
Version 1.0.0
License
All-time Installs 6
Active Installs 6
Total Versions 1
Frequently Asked Questions

What is Document Processor?

PDF和Word文档处理技能,支持PDF-Word相互转换、页面提取、去水印、合并拆分等操作. It is an AI Agent Skill for Claude Code / OpenClaw, with 774 downloads so far.

How do I install Document Processor?

Run "/install document-processor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Document Processor free?

Yes, Document Processor is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Document Processor support?

Document Processor is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Document Processor?

It is built and maintained by youmu88 (@youmu88); the current version is v1.0.0.

💬 Comments