| name | pypdf |
| description | Manipulate PDF documents programmatically. Merge, split, rotate, and watermark PDFs. Extract text and metadata. Handle form filling and encryption/decryption. |
| version | 1.0.0 |
| category | data |
| type | skill |
| capabilities | ["pdf_merging","pdf_splitting","page_rotation","watermarking","text_extraction","metadata_handling","form_filling","encryption_decryption"] |
| tools | ["python","pypdf","reportlab"] |
| tags | ["pdf","document-manipulation","merge","split","watermark","encryption","office-automation"] |
| platforms | ["windows","macos","linux"] |
| related_skills | ["python-docx"] |
| requires | [] |
| scripts_exempt | true |
Pypdf
Overview
PyPDF is a pure-Python library for working with PDF files. This skill covers comprehensive patterns for PDF manipulation including:
- PDF merging - Combine multiple PDFs into one document
- PDF splitting - Extract specific pages or split into multiple files
- Page rotation - Rotate pages by 90, 180, or 270 degrees
- Watermarking - Add text or image watermarks to pages
- Text extraction - Extract text content from PDF pages
- Metadata handling - Read and modify PDF metadata
- Form filling - Fill PDF form fields programmatically
- Encryption/Decryption - Secure PDFs with passwords
When to Use This Skill
USE when:
- Merging multiple PDF files into a single document
- Splitting large PDFs into smaller files
- Extracting specific pages from PDFs
- Adding watermarks or stamps to documents
- Extracting text content for analysis
- Reading or modifying PDF metadata
- Filling PDF forms programmatically
- Encrypting or decrypting PDF files
- Adding page numbers or headers/footers
- Rotating or reordering pages
- Automating PDF workflows in pipelines
DON'T USE when:
- Creating PDFs from scratch (use reportlab or weasyprint)
- Need advanced text layout control (use reportlab)
- Converting other formats to PDF (use dedicated converters)
- Need OCR for scanned documents (use pytesseract + pdf2image)
- Working with complex form creation (use reportlab)
- Need to edit existing text content (limited support)
Prerequisites
Installation
pip install pypdf
uv pip install pypdf
pip install pypdf[crypto]
*See sub-skills for full details.*
```python
from pypdf import PdfReader, PdfWriter, PdfMerger
from pypdf.errors import PdfReadError
print("pypdf installed successfully!")
print(f"Version: {pypdf.__version__}")