Compress PDFs
Make a PDF smaller by re-compressing its images. Text, vector graphics and the document structure are left alone.
POST https://api.pdfdispatch.com/v1/pdf/optimize
Form fields
| Field | Type | Default | What it does |
|---|---|---|---|
files required | file(s) | – | The PDFs to make smaller. |
imageQuality | integer | 80 | JPEG quality for the re-compressed images, 1 to 100. Lower is smaller and blurrier. |
On the conversion routes the same happens with optimizeImages=true (and, if you like,
imageQuality).
Example
curl --fail-with-body \
--header "Authorization: Bearer $PDD_KEY" \
--form files=@catalogue.pdf \
--form imageQuality=70 \
--output catalogue-small.pdf \
https://api.pdfdispatch.com/v1/pdf/optimize
How much you save depends on the images. A catalogue full of photos often shrinks to a third; a text-only invoice hardly changes. Compare the result before you lower the quality further: below about 60, photos start to show blocks.