Compress PDF

Reduce the file size of your PDF documents without losing quality.

Overview

The compress-pdf operation allows you to significantly reduce the size of PDF files. This is particularly useful for optimizing documents for web delivery or email attachments.

How to Compress a PDF

To compress a PDF, create a task with the operation set to compress-pdf and attach your PDF file.

bash
curl -X POST https://api.flimpa.com/api/v1/tasks \
  -H "X-API-Key: your_api_key" \
  -F "operation=compress-pdf" \
  -F "file=@/path/to/large-document.pdf"

Once the task is created, poll the status endpoint until the task is completed, then download the optimized PDF.

Best Practices

  • File Size: Ensure your input PDF is under the 20 MB limit.
  • Content: Compression works best on PDFs with large, unoptimized images. Text-heavy PDFs may see less reduction.