Compressor APIProcessingDocuments

Documents

The Compressor Documents API provides reliable, high-efficiency compression and conversion for modern document workflows. It is designed to significantly reduce file sizes while preserving layout, typography, and visual fidelity — making documents faster to transmit, easier to store, and more suitable for web and mobile delivery.

By combining format-aware optimization with advanced compression techniques, Compressor can achieve substantial size reductions across a wide range of document types, with the option to convert files into highly optimized PDFs for maximum compatibility and portability.

Typical Use Cases

  • Compressing PDFs for faster downloads
  • Converting office documents to optimized PDFs
  • Reducing storage and bandwidth costs
  • Preparing documents for web delivery or email distribution
  • Automating document pipelines in SaaS applications

Document Compression API

All document processing supports the standard compression parameter, allowing you to control the balance between file size reduction and output fidelity.

Compression settings are passed under the document namespace:

{
  "document": {
    "compression": "high"
  }
}

Compression Modes

  • medium - balanced optimization suitable for most documents. Preserves layout and readability while reducing file size.

  • high (default) - more aggressive compression for performance-sensitive workflows such as document delivery, downloads, and email attachments.

  • ultra - maximum compression for the smallest possible output size. Best suited for archival, large batch processing, or bandwidth-constrained environments.

The default compression mode is high. Higher compression levels generally produce smaller files. The API automatically applies format-specific optimizations to maintain document integrity.

Supported Input Formats

The Documents API accepts all major office and document formats, including: PDF, DOCX, XLSX, PPTX, Apple Pages (.pages), Apple Keynote (.keynote), Apple Numbers (.numbers), ODT, ODS, ODP.

Input format detection is automatic. You do not need to declare the source format explicitly.

Output Formats

By default, Compressor preserves the original document format:

  • PDF → PDF
  • DOCX → DOCX
  • XLSX → XLSX
  • PPTX → PPTX
  • ODT → ODT

This ensures compatibility and predictable output without requiring additional configuration.

Converting Documents to PDF

Any supported document format can be converted into a highly optimized PDF by specifying the desired output format.

To convert a document to PDF:

{
  "document": {
    "output": {
      "format": "pdf"
    }
  }
}

PDF output is optimized for size, structure, and compatibility, making it ideal for web distribution, archiving, and cross-platform viewing.

Format conversion can be combined with compression settings in a single request.

{
  "document": {
    "compression": "ultra",
    "output": {
      "format": "pdf"
    }
  }
}

Notes & Best Practices

  • Use medium compression for most business documents.
  • Use high or ultra when minimizing file size is more important than editability.
  • Convert to PDF when long-term compatibility and consistency are required.
On this page