PDF Lock & Unlock — OpenClaw Plugin
Lock and unlock PDF documents using the PDFAPIHub API. This OpenClaw plugin gives your AI agent the ability to add password protection, set granular permissions, decrypt encrypted PDFs, and inspect PDF security status.
What It Does
Protect PDFs with password encryption or remove password protection from encrypted documents — perfect for securing confidential files, enabling read-only distribution, and unlocking PDFs for further processing.
Features
- AES-256 Encryption — Industry-standard encryption (default)
- AES-128 & RC4 — Alternative encryption for legacy compatibility
- User & Owner Passwords — Separate passwords for viewing vs editing
- Granular Permissions — Control print, copy, modify, annotate, fill forms, extract, assemble
- Multi-Engine Decryption — PyPDF2, pikepdf (AES-256), PyMuPDF, pdfplumber fallback chain
- Re-Encryption — Unlock with old password, lock with new password in one workflow
- Encryption Detection — Check if a PDF is encrypted before processing
- PDF Metadata — Inspect page count, file size, title, author, subject
- Multiple Output Formats — Download URL, base64 string, or raw PDF file
- File Size Tracking — Response includes original and output sizes
Tools
| Tool | Description |
|---|---|
lock_pdf | Add password protection with encryption and granular permissions |
unlock_pdf | Remove password protection from encrypted PDFs |
pdf_info | Check encryption status, page count, and metadata |
Installation
openclaw plugins install clawhub:pdf-lock-unlock
Configuration
Add your API key in ~/.openclaw/openclaw.json:
{
"plugins": {
"entries": {
"pdf-lock-unlock": {
"enabled": true,
"env": {
"PDFAPIHUB_API_KEY": "your-api-key-here"
}
}
}
}
}
Get your free API key at https://pdfapihub.com.
Usage Examples
Just ask your OpenClaw agent:
- "Lock this PDF with password 'secure2026'"
- "Encrypt this contract — allow printing but deny copying and editing"
- "Unlock this PDF with password 'oldpass123'"
- "Is this PDF encrypted?"
- "Re-encrypt this PDF with a new password"
Use Cases
- Confidential Documents — Encrypt contracts, NDAs, and financial reports before sharing
- Read-Only Distribution — Allow viewing and printing but prevent copying or editing
- Client Deliverables — Password-protect reports before sending to clients
- Compliance — Encrypt sensitive PDFs for HIPAA, GDPR, or SOC 2 compliance
- Exam Papers — Lock exam PDFs until exam time, then share the password
- IP Protection — Restrict copying from proprietary documents
- Workflow Automation — Unlock encrypted PDFs before merging, splitting, or parsing
API Documentation
Full API docs: https://pdfapihub.com/docs
License
MIT