Compress PDF API

Compress and reduce a PDF file size by up to 90%

PDF

PDF compressor API reduces file size while optimizing for maximal PDF quality by compressing text, graphics, and images, subsetting fonts, and optimizing document structure.

Copy parameter's URL Secret Secret
Type: String

Authentication secret must be provided as a query parameter. If omitted, token must be provided.

Show all
Copy parameter's URL Token Token
Type: String

Authentication token must be provided as a query parameter. If omitted, secret must be provided.

Show all
Copy parameter's URL File File Required
Type: File

File to be converted. Value can be URL or file content.

Show all
Copy parameter's URL StoreFile Store file
Type: Bool

Store converted file on our secure server and provides download URL.

Default: False Show all
Copy parameter's URL FileName File name
Type: String

Converted output file name without extension. The extension will be added automatically.

Show all
Copy parameter's URL Timeout Timeout
Type: Integer

Conversion timeout in seconds.

Default: 900 Range: 10 .. 1200 Show all
Copy parameter's URL Password Open Password
Type: String

Sets the password to open protected documents.

Show all
Copy parameter's URL Presets Compression Presets
Type: Collection

Choose compression level from presets. If preset is selected all other compression options are ignored.

Default: none Values: none text archive web ebook printer Show all
Copy parameter's URL ColorImageCompression Color image compression
Type: Collection

Color image compression algorithm.

Default: jpg Values: none jpg jpx zip Show all
Copy parameter's URL ColorImageQuality Color image quality
Type: Integer

Color image compression quality. The parameter applies only to JPX and JPG compressions.

Default: 50 Range: 10 .. 100 Show all
Copy parameter's URL ColorImageDownsample Color image downsample
Type: Bool

Enable Bicubic image downsampling and decreases the number of pixels in the color image which in turn makes the file smaller.

Default: False Show all
Copy parameter's URL ColorImageThresholdDpi Color image resample threshold
Type: Integer

Threshold in DPI to activate color images resampling. ColorImageDownsample property must be enabled.

Default: 200 Range: 72 .. 3000 Show all
Copy parameter's URL ColorImageResampleDpi Color image resample
Type: Integer

Color image resolution in DPI after Bicubic resampling. ColorImageDownsample property must be enabled.

Default: 150 Range: 10 .. 2400 Show all
Copy parameter's URL GrayscaleImageCompression Grayscale image compression
Type: Collection

Grayscale image compression algorithm.

Default: jpg Values: none jpg jpx zip Show all
Copy parameter's URL GrayscaleImageQuality Grayscale image quality
Type: Integer

Grayscale image compression quality. The parameter applies only to JPX and JPG compressions.

Default: 50 Range: 10 .. 100 Show all
Copy parameter's URL GrayscaleImageDownsample Grayscale image downsample
Type: Bool

Enable Bicubic image downsampling and decreases the number of pixels in the grayscale image which in turn makes the file smaller.

Default: False Show all
Copy parameter's URL GrayscaleImageThresholdDpi Grayscale image resample threshold
Type: Integer

Threshold in DPI to activate grayscale images resampling. GrayscaleImageDownsample property must be enabled.

Default: 200 Range: 72 .. 3000 Show all
Copy parameter's URL GrayscaleImageResampleDpi Grayscale image resample
Type: Integer

Grayscale image resolution in DPI after Bicubic resampling. GrayscaleImageDownsample property must be enabled.

Default: 150 Range: 10 .. 2400 Show all
Copy parameter's URL MonochromeImageCompression Monochrome image compression
Type: Collection

Monochrome image compression algorithm.

Default: jbig2l Values: none jbig2 jbig2l fax zip Show all
Copy parameter's URL MonochromeImageQuality Monochrome image quality
Type: Integer

Monochrome image compression quality. The parameter applies only to jbig2 and jbig2l compressions.

Default: 5 Range: 1 .. 10 Show all
Copy parameter's URL MonochromeImageDownsample Monochrome image downsample
Type: Bool

Enable Bicubic image downsampling and decreases the number of pixels in the monochrome image which in turn makes the file smaller.

Default: False Show all
Copy parameter's URL MonochromeImageThresholdDpi Monochrome image resample threshold
Type: Integer

Threshold in DPI to activate Monochrome images resampling. MonochromeImageDownsample property must be enabled.

Default: 200 Range: 100 .. 3000 Show all
Copy parameter's URL MonochromeImageResampleDpi Monochrome image resample
Type: Integer

Monochrome image resolution in DPI after Bicubic resampling. MonochromeImageDownsample property must be enabled.

Default: 150 Range: 10 .. 240 Show all
Copy parameter's URL RemoveBookmarks Remove bookmarks
Type: Bool

Remove bookmarks from the PDF file.

Default: False Show all
Copy parameter's URL RemoveAnnotations Remove annotations
Type: Bool

Remove text annotations from the PDF file.

Default: False Show all
Copy parameter's URL RemoveForms Remove forms
Type: Bool

Remove PDF forms from the PDF file.

Default: False Show all
Copy parameter's URL RemovePageLabels Remove page labels
Type: Bool

Remove page labels from the PDF file.

Default: False Show all
Copy parameter's URL RemoveLayers Remove layers
Type: Bool

Removes hidden layers and flatten visible ones.

Default: False Show all
Copy parameter's URL RemoveArticleThreads Remove article threads
Type: Bool

Remove article threads from the PDF file.

Default: False Show all
Copy parameter's URL RemoveTaggedInfo Remove tagged information
Type: Bool

Remove tagged information from the PDF file.

Default: True Show all
Copy parameter's URL RemovePageThumbnails Remove page thumbnails
Type: Bool

Remove page thumbnails from the PDF file.

Default: True Show all
Copy parameter's URL RemoveDuplicates Remove duplicates
Type: Bool

Remove duplicate fonts and color profiles from the PDF file.

Default: True Show all
Copy parameter's URL RemoveAlternateImages Remove alternate images
Type: Bool

Removes alternate images and leave only the one for on-screen viewing.

Default: True Show all
Copy parameter's URL RemoveNamedDestinations Remove named destinations
Type: Bool

Remove named destinations from the PDF file.

Default: False Show all
Copy parameter's URL RemoveEmbeddedFiles Remove embedded files
Type: Bool

Remove embedded/attachments files from the PDF file.

Default: True Show all
Copy parameter's URL RemovePieceInformation Remove piece information
Type: Bool

Remove piece information dictionaries like Adobe Illustrator or Photoshop private data.

Default: True Show all
Copy parameter's URL UnembedBaseFonts Unembed base fonts
Type: Bool

Specifies whether to remove the base fonts from the PDF file.

Default: False Show all
Copy parameter's URL SubsetEmbeddedFonts Subset embedded fonts
Type: Bool

Output PDF should only contain font characters utilized in the original document, and any unused glyphs from all fonts in the document should be removed.

Default: False Show all
Copy parameter's URL CreateObjectStreams Create object streams
Type: Bool

Create object streams in the PDF file. An object stream represents a stream that contains a sequence of PDF objects. This allows a greater number of PDF objects to be compressed. Property compatible with Acrobat 6/PDF v1.5 and later.

Default: True Show all
Copy parameter's URL Optimize Optimize content
Type: Bool

Optimize page content streams in the PDF file.

Default: True Show all
Copy parameter's URL LzwToFlate Lzw to flate
Type: Bool

In streams that use LZW encoding, use Flate instead.

Default: True Show all
Copy parameter's URL Linearize Linearize
Type: Bool

Linearize PDF file and optimize for fast Web View.

Default: False Show all
Copy parameter's URL PreservePdfa Preserve PDF/A
Type: Bool

Preserve the PDF/A standard in the PDF file.

Default: True Show all

Code snippet

// Code snippet is using the ConvertAPI JavaScript Client: https://github.com/ConvertAPI/convertapi-js

// Code snippet is using the ConvertAPI Node.js Client: https://github.com/ConvertAPI/convertapi-nodejs

// Code snippet is using the ConvertAPI PHP Client: https://github.com/ConvertAPI/convertapi-php

// Code snippet is using the ConvertAPI Java Client: https://github.com/ConvertAPI/convertapi-java

// Code snippet is using the ConvertAPI C# Client: https://github.com/ConvertAPI/convertapi-dotnet

# Code snippet is using the ConvertAPI Ruby Client: https://github.com/ConvertAPI/convertapi-ruby

# Code snippet is using the ConvertAPI Python Client: https://github.com/ConvertAPI/convertapi-python

// Code snippet is using the ConvertAPI Go Client: https://github.com/ConvertAPI/convertapi-go

REM Code snippet is using the command line utility program: https://github.com/ConvertAPI/convertapi-cli

<!-- For conversions with the multiple file result please refer to this example: https://repl.it/@ConvertAPI/HTML-Form-with-multiple-file-result -->

Resources

In addition to the interactive code snippet above, we wrote some useful articles about the PDF to COMPRESS conversion. Read more about the converter, integration and advanced techniques in the articles below: