PDF Compress — OpenClaw Plugin
Compress and optimize PDF files using the PDFAPIHub API. This OpenClaw plugin gives your AI agent the ability to reduce PDF file sizes, compress images, upload files, and inspect document metadata.
What It Does
Reduce PDF and image file sizes with configurable compression — perfect for email attachments, web uploads, storage optimization, and mobile-friendly documents.
Features
- PDF Compression — Rewrite streams, deflate content, clean unused objects
- 4 Compression Levels — Low (light), medium (moderate), high (full, default), max (aggressive)
- Compression Statistics — Original size, compressed size, ratio percentage, bytes saved
- Image Compression — Compress images to JPEG with quality control (1-100)
- File Upload — Upload files to get public URLs for processing
- File Listing — List all uploaded files with timestamps
- PDF Metadata — Check page count, file size, encryption status, and properties
- Multiple Output Formats — Download URL, base64 string, or raw file
- Auto-Cleanup — Uploaded files automatically deleted after 30 days
Tools
| Tool | Description |
|---|---|
compress_pdf | Reduce PDF file size with configurable compression levels |
compress_image | Compress images to JPEG with quality control and stats |
pdf_info | Check file size, page count, and metadata |
upload_file | Upload files to get a public URL for processing |
list_files | List uploaded files |
Installation
openclaw plugins install clawhub:pdf-compress
Configuration
Add your API key in ~/.openclaw/openclaw.json:
{
"plugins": {
"entries": {
"pdf-compress": {
"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:
- "Compress this PDF to reduce file size"
- "Compress with maximum compression"
- "How big is this PDF before and after compression?"
- "Compress this image to 75% quality"
- "Show me my uploaded files"
Use Cases
- Email Attachments — Compress large PDFs to fit within email size limits
- Web Upload Optimization — Reduce file size before uploading to portals with size restrictions
- Storage Savings — Compress archival PDFs to reduce cloud storage costs
- Faster Downloads — Optimize PDF size for faster user downloads
- Mobile-Friendly — Compress PDFs for better performance on mobile devices
- Batch Optimization — Compress all PDFs in a document management system
- Pre-Processing — Compress images before embedding in PDF generation
Compression Levels
| Level | Aliases | Behaviour |
|---|---|---|
low | small | Light cleanup |
medium | med | Moderate optimization |
high | default | Full optimization (default) |
max | maximum, aggressive | Same as high |
API Documentation
Full API docs: https://pdfapihub.com/docs
License
MIT