pdf_compress
Shrink PDF file size by rebuilding the document structure and removing orphaned data. Optionally strip metadata and flatten forms for further reduction.
Instructions
Attempt to reduce PDF file size by rebuilding the document structure. Copies all pages to a fresh PDF (dropping orphaned objects), and optionally strips metadata. Results vary — works best on PDFs with accumulated edits or orphaned data.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | PDF file path | |
| outputPath | Yes | Output path | |
| flattenForms | No | Flatten form fields to reduce size (default: false) | |
| stripMetadata | No | Remove title, author, subject, keywords (default: false) |