Compress PDF
Reduces the file size of a PDF by optimizing images, fonts, and document resources, and discarding unneeded objects and metadata, then makes the compressed PDF available for download.
Field Precedence: When both are set, discard_objects.flatten_form_fields takes precedence over discard_objects.discard_form_fields, and discard_objects.discard_annotations takes precedence over discard_objects.discard_hidden_annotations (and makes discard_user_data.discard_rich_media redundant, since all annotations are already removed).
Endpoint
OAuth Scope
curl --request POST \
--url https://www.zohoapis.com/pdfeditor/api/v1/pdf/compress \
--header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
--header 'content-type: multipart/form-data' \
-F 'file=@file_path' \
-F 'input_options={
"image_settings": {
"color_images": {
"enable_resize": true,
"enable_dpi_reduction": true,
"target_dpi": 150,
"max_dimension": 1500,
"convert_to_grayscale": false,
"compression_type": "jpeg",
"quality": 0.75,
"deduplicate_images": true,
"extract_inline_images": false
},
"grayscale_images": {
"enable_resize": true,
"enable_dpi_reduction": true,
"target_dpi": 150,
"max_dimension": 1500,
"compression_type": "jpeg",
"quality": 0.8,
"deduplicate_images": true
},
"monochrome_images": {
"enable_resize": false,
"enable_dpi_reduction": true,
"target_dpi": 300,
"compression_type": "lossless",
"quality": "lossless"
}
},
"font_settings": {
"deduplicate_fonts": true,
"subset_fonts": true
},
"resource_optimization": {
"remove_unused_resources": true,
"deduplicate_streams": true,
"compress_objects": true,
"enable_stream_compression": true
},
"discard_objects": {
"discard_form_fields": false,
"flatten_form_fields": true,
"discard_annotations": false,
"discard_hidden_annotations": true,
"discard_alternate_images": true,
"discard_bookmarks": true,
"discard_thumbnails": true,
"discard_page_actions": true,
"discard_open_actions": true,
"discard_output_intents": true,
"discard_optional_content_layers": true
},
"discard_user_data": {
"discard_metadata": true,
"discard_javascript": true,
"discard_embedded_files": true,
"discard_rich_media": true,
"discard_accessibility_tags": false,
"discard_private_application_data": true
},
"color_management": {
"normalize_transparency": true,
"force_rgb": true
}
}' \
-F 'password=OpenSesame123'Request Body
multipart/form-dataThe source PDF to compress, uploaded directly or imported from a publicly accessible URL. The file must be no larger than 50 MB, contain no more than 400 pages, and have no page larger than 2,400 square inches. Its filename must not exceed 255 characters. Supported formats: pdf.
Configures how the PDF is compressed. At least one setting must be provided.
{
"image_settings": {
"color_images": {
"enable_resize": true,
"enable_dpi_reduction": true,
"target_dpi": 150,
"max_dimension": 1500,
"convert_to_grayscale": false,
"compression_type": "jpeg",
"quality": 0.75,
"deduplicate_images": true,
"extract_inline_images": false
},
"grayscale_images": {
"enable_resize": true,
"enable_dpi_reduction": true,
"target_dpi": 150,
"max_dimension": 1500,
"compression_type": "jpeg",
"quality": 0.8,
"deduplicate_images": true
},
"monochrome_images": {
"enable_resize": false,
"enable_dpi_reduction": true,
"target_dpi": 300,
"compression_type": "lossless",
"quality": "lossless"
}
},
"font_settings": {
"deduplicate_fonts": true,
"subset_fonts": true
},
"resource_optimization": {
"remove_unused_resources": true,
"deduplicate_streams": true,
"compress_objects": true,
"enable_stream_compression": true
},
"discard_objects": {
"discard_form_fields": false,
"flatten_form_fields": true,
"discard_annotations": false,
"discard_hidden_annotations": true,
"discard_alternate_images": true,
"discard_bookmarks": true,
"discard_thumbnails": true,
"discard_page_actions": true,
"discard_open_actions": true,
"discard_output_intents": true,
"discard_optional_content_layers": true
},
"discard_user_data": {
"discard_metadata": true,
"discard_javascript": true,
"discard_embedded_files": true,
"discard_rich_media": true,
"discard_accessibility_tags": false,
"discard_private_application_data": true
},
"color_management": {
"normalize_transparency": true,
"force_rgb": true
}
}Show Sub-Attributes
Compression settings for images in the PDF, grouped by image type.
{
"color_images": {
"enable_resize": true,
"enable_dpi_reduction": true,
"target_dpi": 150,
"max_dimension": 1500,
"convert_to_grayscale": false,
"compression_type": "jpeg",
"quality": 0.75,
"deduplicate_images": true,
"extract_inline_images": false
},
"grayscale_images": {
"enable_resize": true,
"enable_dpi_reduction": true,
"target_dpi": 150,
"max_dimension": 1500,
"compression_type": "jpeg",
"quality": 0.8,
"deduplicate_images": true
},
"monochrome_images": {
"enable_resize": false,
"enable_dpi_reduction": true,
"target_dpi": 300,
"compression_type": "lossless",
"quality": "lossless"
}
}Show Sub-Attributes
Compression settings applied to full-color images.
{
"enable_resize": true,
"enable_dpi_reduction": true,
"target_dpi": 150,
"max_dimension": 1500,
"convert_to_grayscale": false,
"compression_type": "jpeg",
"quality": 0.75,
"deduplicate_images": true,
"extract_inline_images": false
}Show Sub-Attributes
Resizes full-color images down to max_dimension when they exceed it.
Reduces the effective resolution of full-color images down to target_dpi when they exceed it.
The resolution, in DPI, full-color images are downscaled to when enable_dpi_reduction is true.
The maximum width or height, in pixels, full-color images are downscaled to when enable_resize is true.
Converts full-color images to grayscale.
The compression algorithm applied to full-color images.
The JPEG compression quality (0–1) for full-color images. Applies only when compression_type is jpeg.
Reuses a single copy of a full-color image wherever it repeats in the document, instead of storing it multiple times.
Extracts inline images embedded directly in page content streams so they can be compressed like other images.
Compression settings applied to grayscale images.
{
"enable_resize": true,
"enable_dpi_reduction": true,
"target_dpi": 150,
"max_dimension": 1500,
"compression_type": "jpeg",
"quality": 0.8,
"deduplicate_images": true
}Show Sub-Attributes
Resizes grayscale images down to max_dimension when they exceed it.
Reduces the effective resolution of grayscale images down to target_dpi when they exceed it.
The resolution, in DPI, grayscale images are downscaled to when enable_dpi_reduction is true.
The maximum width or height, in pixels, grayscale images are downscaled to when enable_resize is true.
The compression algorithm applied to grayscale images.
The JPEG compression quality (0–1) for grayscale images. Applies only when compression_type is jpeg.
Reuses a single copy of a grayscale image wherever it repeats in the document, instead of storing it multiple times.
Compression settings applied to 1-bit (monochrome) images.
{
"enable_resize": false,
"enable_dpi_reduction": true,
"target_dpi": 300,
"compression_type": "lossless",
"quality": "lossless"
}Show Sub-Attributes
Resizes 1-bit (monochrome) images based on the page size and target_dpi when enable_dpi_reduction is true.
Reduces the effective resolution of monochrome images down to target_dpi when they exceed it.
The resolution, in DPI, monochrome images are downscaled to when enable_dpi_reduction is true.
The compression algorithm applied to monochrome images.
The compression quality applied to monochrome images.
Font-related compression settings.
{
"deduplicate_fonts": true,
"subset_fonts": true
}Show Sub-Attributes
Consolidates identical embedded font programs into a single shared copy.
Reduces each embedded font to only the glyphs actually used in the document.
Settings for optimizing the PDF's internal object and stream storage.
{
"remove_unused_resources": true,
"deduplicate_streams": true,
"compress_objects": true,
"enable_stream_compression": true
}Show Sub-Attributes
Removes page resources (images, fonts, color spaces, and similar) that are no longer referenced by any page content.
Consolidates identical content streams that appear more than once in the document into a single shared copy.
Compresses the PDF's internal object streams.
Compresses the PDF's content streams.
Configures which structural objects are discarded from the PDF.
{
"discard_form_fields": false,
"flatten_form_fields": true,
"discard_annotations": false,
"discard_hidden_annotations": true,
"discard_alternate_images": true,
"discard_bookmarks": true,
"discard_thumbnails": true,
"discard_page_actions": true,
"discard_open_actions": true,
"discard_output_intents": true,
"discard_optional_content_layers": true
}Show Sub-Attributes
Removes the PDF's fillable form entirely.
Flattens the PDF's form fields into static page content.
Removes every annotation from every page.
Removes alternate image representations stored alongside an image's primary representation.
Removes the PDF's bookmark/outline tree.
Removes cached page thumbnail images.
Removes per-page additional actions.
Removes the document's open action.
Removes the document's output intents.
Removes optional content group (layer) definitions.
Configures which document-level metadata and embedded data is discarded.
{
"discard_metadata": true,
"discard_javascript": true,
"discard_embedded_files": true,
"discard_rich_media": true,
"discard_accessibility_tags": false,
"discard_private_application_data": true
}Show Sub-Attributes
Removes the document's information dictionary and XMP metadata.
Removes embedded JavaScript and related additional actions.
Removes all embedded file attachments.
Removes rich media (video/3D) annotations.
Removes the document's structure tree and tagging information.
Removes application-specific private data stored alongside pages.
Settings for normalizing color spaces in the PDF.
{
"normalize_transparency": true,
"force_rgb": true
}Show Sub-Attributes
Normalizes transparency groups in the PDF to a consistent color space.
Converts CMYK images without transparency to RGB.
The password to unlock the source PDF, if it is password-protected.
// Note: payload contains multiple type attributes
// type: file
file = quarterly-review.pdf
// type: object
input_options = {
"image_settings": {
"color_images": {
"enable_resize": true,
"enable_dpi_reduction": true,
"target_dpi": 150,
"max_dimension": 1500,
"convert_to_grayscale": false,
"compression_type": "jpeg",
"quality": 0.75,
"deduplicate_images": true,
"extract_inline_images": false
},
"grayscale_images": {
"enable_resize": true,
"enable_dpi_reduction": true,
"target_dpi": 150,
"max_dimension": 1500,
"compression_type": "jpeg",
"quality": 0.8,
"deduplicate_images": true
},
"monochrome_images": {
"enable_resize": false,
"enable_dpi_reduction": true,
"target_dpi": 300,
"compression_type": "lossless",
"quality": "lossless"
}
},
"font_settings": {
"deduplicate_fonts": true,
"subset_fonts": true
},
"resource_optimization": {
"remove_unused_resources": true,
"deduplicate_streams": true,
"compress_objects": true,
"enable_stream_compression": true
},
"discard_objects": {
"discard_form_fields": false,
"flatten_form_fields": true,
"discard_annotations": false,
"discard_hidden_annotations": true,
"discard_alternate_images": true,
"discard_bookmarks": true,
"discard_thumbnails": true,
"discard_page_actions": true,
"discard_open_actions": true,
"discard_output_intents": true,
"discard_optional_content_layers": true
},
"discard_user_data": {
"discard_metadata": true,
"discard_javascript": true,
"discard_embedded_files": true,
"discard_rich_media": true,
"discard_accessibility_tags": false,
"discard_private_application_data": true
},
"color_management": {
"normalize_transparency": true,
"force_rgb": true
}
}
// type: string
password = OpenSesame123 {
"status": "inprogress",
"status_check_url": "https://www.zohoapis.com/pdfeditor/api/v1/pdf/compress/job/3f65c7592a741d98e46bf310cbe678f574a1d51fce306a8d9b6430217e538acd"
}
Rate Limits
Duration - Time window for the threshold.
Threshold - Number of API calls allowed within the specified duration.
Lock Period - Wait time before consecutive API requests.
© 2026, Zoho Corporation Pvt. Ltd. All Rights Reserved.