Compress PDF
pdf_compressShrink PDFs by re-rendering each page as a JPEG, ideal for scans and photo-heavy files. Choose email, balanced or high presets, or set DPI and quality, and see before/after size.
Instructions
Shrink a PDF by re-rendering every page as a JPEG image (best for scans and photo-heavy files). Presets like the website: email (96 DPI, quality 55), balanced (144 DPI, 72), high (220 DPI, 85); or set dpi/quality yourself; optional grayscale. The result loses selectable text, links and form fields. Reports before/after size and a verdict ("bigger" means keep the original: the PDF was already efficient). Web version: https://s3eidat.github.io/pdf-compress/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dpi | No | Override the preset resolution (36-300 DPI). | |
| file | Yes | The PDF: a local file path (absolute, or relative to the server's --root) or base64 data (raw or a data: URI). | |
| output | No | Where to write the result: a file path, or a folder ending in "/". Default: the server output folder (a temp folder unless --out-dir is set). | |
| preset | No | Quality preset. Default "balanced". | balanced |
| quality | No | Override the preset JPEG quality (30-95). | |
| password | No | Password, if the PDF is protected. | |
| grayscale | No | Convert pages to grayscale. | |
| returnBase64 | No | Also return the output as base64 in the result (only for small files). Default false. |