home / skills / dkyazzentwatwa / chatgpt-skills / pdf-toolkit

pdf-toolkit skill

/pdf-toolkit

This skill helps you manipulate PDFs programmatically by merging, splitting, rotating, watermarking, compressing, and encrypting documents.

npx playbooks add skill dkyazzentwatwa/chatgpt-skills --skill pdf-toolkit

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
1.5 KB
---
name: pdf-toolkit
description: Comprehensive PDF manipulation - merge, split, rotate, extract pages, add watermarks, compress, and encrypt PDFs programmatically.
---

# PDF Toolkit

Comprehensive PDF manipulation toolkit for merging, splitting, rotating, and more.

## Features

- **Merge**: Combine multiple PDFs into one
- **Split**: Extract pages or split into chunks
- **Rotate**: Rotate pages by 90/180/270 degrees
- **Extract**: Extract specific pages or page ranges
- **Watermark**: Add text/image watermarks
- **Compress**: Reduce file size
- **Encrypt**: Add password protection
- **Metadata**: Edit PDF metadata
- **Page Numbers**: Add page numbers
- **Bookmarks**: Add/remove bookmarks

## Quick Start

```python
from pdf_toolkit import PDFToolkit

toolkit = PDFToolkit()

# Merge PDFs
toolkit.merge(['doc1.pdf', 'doc2.pdf'], 'merged.pdf')

# Extract pages
toolkit.load('document.pdf').extract_pages([1, 3, 5], 'extracted.pdf')

# Add watermark
toolkit.load('document.pdf').watermark('CONFIDENTIAL', output='watermarked.pdf')
```

## CLI Usage

```bash
# Merge
python pdf_toolkit.py merge file1.pdf file2.pdf --output merged.pdf

# Split
python pdf_toolkit.py split document.pdf --pages 10 --output chunks/

# Rotate
python pdf_toolkit.py rotate document.pdf --angle 90 --pages 1-5 --output rotated.pdf

# Watermark
python pdf_toolkit.py watermark document.pdf --text "DRAFT" --output watermarked.pdf
```

## Dependencies

- PyPDF2>=3.0.0
- PyMuPDF>=1.23.0
- pillow>=10.0.0
- reportlab>=4.0.0

Overview

This skill provides a comprehensive PDF manipulation toolkit for common programmatic workflows. It supports merging, splitting, rotating, extracting pages, adding watermarks, compressing, encrypting, and editing metadata. The API is designed for scriptable and CLI-driven use so you can automate PDF tasks in pipelines or integrate them into applications.

How this skill works

The toolkit exposes a lightweight Python API and a command-line interface that wrap tested PDF libraries to perform page-level operations. You can load a document, chain operations (extract, rotate, watermark, compress), and write the result to a new file. Operations use established libraries for robust parsing and rendering, with options for batch processing and password protection.

When to use it

  • Combine multiple reports into a single distributable PDF
  • Split large documents into smaller sections for review or archiving
  • Apply consistent watermarks or page numbers across a set of files
  • Encrypt PDFs before sharing sensitive information
  • Compress large PDFs to reduce storage or email attachment size

Best practices

  • Work on copies of original files to avoid accidental overwrite or data loss
  • Specify explicit page ranges when extracting or rotating to reduce errors
  • Use batch operations for large sets of files to improve consistency
  • Test compression and encryption settings on representative files to balance size and quality
  • Validate output files (open and inspect a few pages) after automated processing

Example use cases

  • Merge monthly invoices into a single PDF for accounting uploads
  • Extract selected chapters from a textbook and create a short study packet
  • Rotate scanned pages that were imported upside down and save a corrected PDF
  • Add a visible 'CONFIDENTIAL' watermark before sending draft documents externally
  • Compress archived PDFs to reduce cloud storage costs while retaining readability

FAQ

Which Python libraries does this skill use under the hood?

It relies on standard PDF libraries such as PyPDF2 and PyMuPDF, plus Pillow and ReportLab for raster and watermark tasks.

Can I process many files in a single command?

Yes. The toolkit supports batch and CLI operations so you can merge, compress, or watermark multiple files in one run.