PDF Compression, Size Reduction

Compress PDF Files and Reduce Size via API

Reduce PDF file size programmatically with configurable quality levels. Get compression statistics in response headers: original size, compressed size, and compression ratio. Perfect for storage optimization.

cURLPythonNode.jsn8n
# Compress a PDF file
curl -X POST \
  https://api.convertfilefast.com/v2/pdf/compress \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@document.pdf" \
  -F "quality=medium" \
  -F "remove_metadata=true" \
  -D headers.txt \
  --output compressed.pdf

# HTTP 200 OK — Headers include compression stats:
# X-Original-Size, X-Compressed-Size, X-Compression-Ratio
Conversion completed in <2s

Advantages

Why use our API?

Complete and reliable solution for integration in any tech stack.

Quality Levels

Choose from low, medium, and high quality levels to balance file size reduction vs output quality.

Compression Stats

Response headers include X-Original-Size, X-Compressed-Size, and X-Compression-Ratio for each request.

Metadata Removal

Optionally strip PDF metadata (author, creation date, software) to further reduce file size.

Significant Reduction

Achieve up to 70% size reduction on image-heavy PDFs while maintaining acceptable visual quality.

Automation Ready

Integrate into file upload pipelines, storage workflows, or email attachment processors with n8n.

Zero Storage

PDFs are compressed in memory and deleted immediately after processing. Complete privacy guaranteed.

FAQ

Frequently Asked Questions

What quality levels are available when compressing a PDF?

Three levels are available through the `quality` field: `low`, `medium`, and `high`. `low` produces the smallest file and is best for archiving or email attachments, `medium` is the balanced default, and `high` keeps images close to the original at a more modest size reduction.

How much can the API reduce a PDF file size?

Image-heavy PDFs typically shrink by up to 70%. Every response includes the exact numbers in its headers — `X-Original-Size`, `X-Compressed-Size`, and `X-Compression-Ratio` — so your workflow can verify the result instead of guessing.

Can I strip PDF metadata while compressing?

Yes. Send `remove_metadata=true` and the API removes author, creation date, and producer software fields before returning the file. This reduces size a little further and avoids leaking internal information in documents you publish.

What is the maximum file size supported?

The API accepts PDF files up to 50 MB on the Pro plan and up to 10 MB on the Free plan. Files are compressed in memory and deleted immediately after the response is sent — nothing is stored on our servers.

Start Compressing PDFs via API

Get your API key and compress PDF files in seconds. Free plan includes 10 conversions per month.

No credit card. 10 free conversions on Free plan.