Autype icon

Autype

Interact with the Autype Developer API for document generation, PDF tools, and more

Document Tool → Compress

AI-generated

Summary

Compresses a PDF file

Inputs

  • fileId (required) — ID of the file uploaded via the File resource.
  • level — Compression level: low, medium, or high.
  • waitForCompletion — Whether to wait for the tool job to complete before returning.
  • downloadOutput — Whether to automatically download the output file as binary data after completion. Only applicable when waitForCompletion is true.

Output shape

If downloadOutput is true and the job completes, returns the compressed PDF as binary data; otherwise returns the tool job status as JSON data.

Binary output includes fileName and mimeType; JSON output contains the API response body.

Examples

Example 1: Compress a PDF with medium compression and auto-download output

fileId: 'abc123', level: 'medium', waitForCompletion: true, downloadOutput: true

Links

Discussion