compress_file
Compress a file and return the result as base64. Pass fileBase64 + fileName. Choose EITHER a preset 'level' (light|balanced|maximum, default balanced) OR a 'custom' profile { imageQuality: 1-100, maxDimension?: px, convertFormat?: webp|avif|jpeg } -- supplying both is rejected. Supported families: images (PNG/JPG/WebP/AVIF), PDF (embedded JPEG images re-encoded, no AGPL tool), and Office OOXML (DOCX/PPTX/XLSX embedded media re-encoded). Returns fileBase64, bytesBefore, bytesAfter, gainPercent, mimeType and the output format. If compression would enlarge a non-converted file, the original is returned with 0% gain. WARNING: convertFormat 'avif' is CPU/RAM heavy (>= 1 GB RAM for large images). Max input size: 26214400 decoded bytes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| level | No | ||
| custom | No | ||
| fileName | Yes | ||
| fileBase64 | Yes |