Reduce PDF file size by up to 90% while preserving visual quality, using an industry-grade Ghostscript-tiered compression engine. Choose basic, medium, or maximum compression to balance size and quality. Perfect for email attachments, web uploads, document archiving, and storage optimization. Upload a PDF and receive a downloadable compressed file with before/after size metrics. Fast, reliable, and production-ready for any document workflow.
{"success":true,"url":"https://pub-6db99bab215e44889f46c4b2a619f8c5.r2.dev/compressed/20260619/bb30c136-f449-4428-8aee-73a1765cde47.pdf","original_size":2526695,"compressed_size":2317882,"compression_ratio":0.9173572591864075,"space_saved_percent":8.264274081359247,"quality_score":0.95,"processing_time":"7149ms"}
curl --location 'https://zylalabs.com/api/12963/pdf+compression+and+optimizer+api/25880/compress+pdf?level=basic&preserve_quality=basic' \
--header 'Content-Type: application/json' \
--form 'image=@"FILE_PATH"'
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 PDF Compression and Optimizer API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
无长期承诺。随时升级、降级或取消。 免费试用包括最多 50 个请求。
(年度计费可节省 2 个月 🎉)
领先企业的信赖之选
The PDF Compression and Optimizer API reduces the file size of PDF documents while maintaining readability and visual appearance. The API accepts a PDF file as input, applies compression and optimization techniques, and returns a downloadable version of the compressed document along with file size statistics.
Users can select different compression levels to balance file size reduction and document quality. Available compression modes include basic, medium, and maximum, allowing developers to choose the most suitable option for their use case. The API can also preserve visual quality during compression to help maintain the appearance of text, images, graphics, and document layouts.
The API is designed for workflows that require smaller PDF files for storage, sharing, uploading, or distribution. Compressed files can reduce storage requirements, improve transfer speeds, decrease bandwidth usage, and help meet file size restrictions imposed by email systems, document portals, and cloud platforms.
Common use cases include:
Reducing PDF size for email attachments
Optimizing files before uploading to websites
Preparing documents for cloud storage
Compressing reports, invoices, and contracts
Reducing storage requirements for archived documents
Optimizing scanned PDF files
Processing large volumes of PDF documents
Automating document management workflows
Preparing files for document sharing platforms
Reducing bandwidth usage during file transfers
Features:
PDF file compression and optimization
Multiple compression levels
Basic, medium, and maximum compression modes
Optional visual quality preservation
File size reduction reporting
Original and compressed file size metrics
Compression ratio information
Downloadable compressed PDF output
JSON response format
HTTPS-based API access
The API returns structured JSON responses containing a download URL for the compressed file, along with information such as original file size, compressed file size, compression ratio, and processing details. It can be integrated into document management systems, cloud storage platforms, workflow automation tools, business applications, web services, and other systems that process PDF documents.