360 Secure SkillHub
360 安全技能中心

PDF Batch Processing Tool

提供四个 Python 命令行脚本,用于批量处理 PDF:合并多个 PDF、按页或范围拆分、旋转页面、从单个文件或整个目录提取文本。所有处理在本地完成,需安装 pypdf 与 Pillow。

potatosolo
potatosolo
热度 34.61
最近更新 2026-05-11 17:36:15
分类:效率依赖:代码执行 / 读写文件应用场景:文件转换 / 自动化脚本 / 工作流 / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add pdf-batch-processing-tool
Metadata
name
pdf-batch-processor
description
Batch process PDF files - merge multiple PDFs, split PDF into multiple files, rotate pages, extract text, extract images, compress PDFs. Use when you need to process multiple PDF files in bulk.

PDF Batch Processor

Batch process multiple PDF files with common operations. No need for expensive online services - process locally, keep your data private.

Core Capabilities

1. Merge multiple PDFs

  • Combine multiple PDF files into one
  • Preserve page order
  • Add table of contents optional

2. Split a PDF

  • Split by page ranges
  • Split each page into a separate file
  • Extract specific pages

3. Rotate pages

  • Rotate all pages or specific page ranges
  • Support 90/180/270 degree rotation

4. Extract text

  • Extract text from all pages
  • Export to plain text or markdown
  • Batch extract from multiple PDFs in a folder

5. Extract images

  • Save all images from a PDF to separate image files
  • Preserve original image quality when possible

6. Compress PDF

  • Reduce file size for web/email
  • Three compression levels (low/medium/high)

Usage Examples

Merge multiple PDFs

python scripts/merge_pdfs.py --output combined.pdf file1.pdf file2.pdf file3.pdf

Split PDF into individual pages

python scripts/split_pdfs.py --input document.pdf --output output-folder/ --mode pages

Extract all text from PDFs in a folder

python scripts/extract_text.py --input ./pdfs/ --output ./text/

Rotate all pages 90 degrees clockwise

python scripts/rotate_pdf.py --input input.pdf --output output.pdf --degrees 90

Installation

pip install pypdf pillow

When to use this skill

✅ Use when:

  • You have multiple PDFs that need the same operation
  • You want to keep processing local (private, no uploads needed)
  • You need to automate PDF processing in a workflow

❌ Don't use when:

  • You only need to edit one page manually (use a GUI PDF editor)
  • The PDF is encrypted/scanned image-only (needs OCR first)
  • You need advanced editing (add/remove content, edit text)

Notes

  • Works with standard PDF files
  • For scanned/image PDFs you need OCR first (use an OCR tool before processing)
  • All processing is local - your files never leave your machine