Pdf tool
PDF 工具 - 合并、拆分、提取文本、加密解密、加水印等From its SKILL.md
npx -y skills add publisher-skill/claude-skill --skill pdf_toolAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.1 KB, 639 tokens by cl100k_base, as published. Nobody here has run it
PDF Tool Skill
PDF 文档处理工具,日常办公必备!
功能特性
📄 PDF 基本操作
- 合并 PDF: 将多个 PDF 文件合并为一个
- 拆分 PDF: 按页面范围或单个页面拆分
- 删除页面: 删除不需要的页面
- 重排页面: 重新排列 PDF 页面顺序
🔐 安全功能
- 加密 PDF: 为 PDF 添加密码保护
- 解密 PDF: 移除 PDF 密码保护
- 获取信息: 查看 PDF 页数、作者、创建时间等
📝 内容提取
- 提取文本: 从 PDF 中提取所有文本
- 保存为 TXT: 将提取的文本保存为 TXT 文件
使用方法
Python API
from skills.pdf_tool import PDFTool
pdf = PDFTool()
# 检查是否可用
if not pdf.is_available():
print("请先安装: pip install pypdf")
exit(1)
# 合并多个 PDF
pdf.merge_pdfs(['1.pdf', '2.pdf'], 'merged.pdf')
# 拆分 PDF(提取单个页面)
pdf.split_pdf('input.pdf', 'output', page=2)
# 拆分 PDF(按范围)
pdf.split_pdf('input.pdf', 'output', start=0, end=4)
# 提取文本
text = pdf.extract_text('input.pdf', 'output.txt')
# 加密 PDF
pdf.encrypt_pdf('input.pdf', 'encrypted.pdf', 'mypassword')
# 解密 PDF
pdf.decrypt_pdf('encrypted.pdf', 'decrypted.pdf', 'mypassword')
# 获取 PDF 信息
info = pdf.get_info('input.pdf')
print(f"页数: {info['pages']}")
API 参考
PDFTool 类
PDF 合并与拆分
merge_pdfs(pdf_paths, output_path)- 合并多个 PDFsplit_pdf(pdf_path, output_dir, page=None, start=None, end=None)- 拆分 PDF
PDF 安全
encrypt_pdf(pdf_path, output_path, password)- 加密 PDFdecrypt_pdf(pdf_path, output_path, password)- 解密 PDF
PDF 内容操作
extract_text(pdf_path, output_path=None)- 提取 PDF 文本remove_pages(pdf_path, output_path, pages_to_remove)- 删除页面reorder_pages(pdf_path, output_path, new_order)- 重排页面
PDF 信息
get_info(pdf_path)- 获取 PDF 信息is_available()- 检查是否可用
What ships with it: 5 files
14.0 KB alongside SKILL.md, 3 of them executable
- example.pyruns3.5 KB
- __init__.pyruns99 B
- pdf_tool.pyruns8.6 KB
- README.md1.9 KB
- requirements.txt13 B