Endpoints
Single endpoint for PDF compression.
POST /api/v1/compress
Upload a PDF and receive the compressed file. Request: multipart/form-data with file and optional query/form parameters.
Parameters
quality
Image compression quality 1–100. Default: 75. Higher values = better image quality, larger file. Use 80–90 for documents with photos.
maxDimension
Max width or height in pixels for embedded images. Default: 1200. Larger images are downsampled to reduce file size.
stripMetadata
Remove EXIF and other metadata. Default: true. Use true for compliance or when metadata is not needed.
convertToJpeg
Convert embedded images to JPEG for smaller size. Default: true. Disable if you need PNG/other formats preserved.
| Name | Type | Default | Description |
|---|---|---|---|
file | file | — | PDF file (required) |
quality | int | 75 | Image compression quality 1–100 |
maxDimension | int | 1200 | Max width/height for images |
stripMetadata | bool | true | Remove EXIF and other metadata |
convertToJpeg | bool | true | Convert images to JPEG for smaller size |
Response headers
X-Compression-Ratio — size reduction ratio (e.g. 0.65 = 35% smaller).
curl -X POST https://api.pdfsqueezer.io/v1/compress \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@document.pdf" \
-F "quality=85" \
-F "maxDimension=1600" \
-F "stripMetadata=true" \
-F "convertToJpeg=true" \
-o compressed.pdf