PDF to COMPRESS API.

The API for compressing PDF files.

API Request

Authentication Parameters
Parameter Description Value
Secret

Optional

String

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

Secret
Token

Optional

String

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

Token
Input Parameters
Parameter Description Value
File

Required

File

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

File
Output Parameters
Parameter Description Value
StoreFile

Optional

Bool

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

Default: False

StoreFile
FileName

Optional

String

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

FileName
Execution Parameters
Parameter Description Value
Timeout

Optional

Integer

Conversion timeout in seconds.

Default: 300

Values: 10 .. 1200

Timeout
Asynchronous Parameters
Parameter Description Value
Async

Optional

Bool

Run conversion job asynchronously.

Default: False

Async
JobId

Optional

String

Conversion job self generated UUID (RFC 4122) used for getting conversion result asynchronously.

JobId
WebHook

Optional

String

Set WebHook URL to call after asynchronous conversion is finished. Async parameter must be enabled.

WebHook
Document Options Parameters
Parameter Description Value
DocumentPassword

Optional

String

Sets the password to open protected documents.

DocumentPassword
Image Compression Parameters
Parameter Description Value
ColorImageCompression

Optional

Collection

Color image compression algorithm.

Default: jpg

Values: jpg, jpx, zip, none

ColorImageCompression
ColorImageQuality

Optional

Integer

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

Default: 50

Values: 10 .. 100

ColorImageQuality
ColorImageThreshold

Optional

Integer

Threshold in DPI to activate color images resampling.

Default: 200

Values: 100 .. 1000

ColorImageThreshold
ColorImageResample

Optional

Integer

Color image resolution in DPI after Bicubic resampling.

Default: 150

Values: 10 .. 1000

ColorImageResample
GrayscaleImageCompression

Optional

Collection

Grayscale image compression algorithm.

Default: jpg

Values: jpg, jpx, zip, none

GrayscaleImageCompression
GrayscaleImageQuality

Optional

Integer

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

Default: 50

Values: 10 .. 100

GrayscaleImageQuality
GrayscaleImageThreshold

Optional

Integer

Threshold in DPI to activate grayscale images resampling.

Default: 200

Values: 100 .. 1000

GrayscaleImageThreshold
GrayscaleImageResample

Optional

Integer

Grayscale image resolution in DPI after Bicubic resampling.

Default: 150

Values: 10 .. 1000

GrayscaleImageResample
MonochromeImageCompression

Optional

Collection

Monochrome image compression algorithm.

Default: fax

Values: jbig2, jbig2l, fax, zip, none

MonochromeImageCompression
MonochromeImageQuality

Optional

Integer

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

Default: 5

Values: 1 .. 10

MonochromeImageQuality
MonochromeImageThreshold

Optional

Integer

Threshold in DPI to activate Monochrome images resampling.

Default: 200

Values: 100 .. 1000

MonochromeImageThreshold
MonochromeImageResample

Optional

Integer

Monochrome image resolution in DPI after Bicubic resampling.

Default: 150

Values: 10 .. 1000

MonochromeImageResample
Remove Objects Parameters
Parameter Description Value
RemoveFonts

Optional

Bool

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

Default: False

RemoveFonts
RemoveBookmarks

Optional

Bool

Remove bookmarks from the PDF file.

Default: False

RemoveBookmarks
RemoveAnnotations

Optional

Bool

Remove text annotations from the PDF file.

Default: False

RemoveAnnotations
RemoveForms

Optional

Bool

Remove PDF forms from the PDF file.

Default: False

RemoveForms
RemovePageLabels

Optional

Bool

Remove page labels from the PDF file.

Default: False

RemovePageLabels
RemoveLayers

Optional

Bool

Remove layers from the PDF file.

Default: False

RemoveLayers
RemoveArticleThreads

Optional

Bool

Remove article threads from the PDF file.

Default: False

RemoveArticleThreads
RemoveTaggedInfo

Optional

Bool

Remove tagged info from the PDF file.

Default: False

RemoveTaggedInfo
RemovePageThumbnails

Optional

Bool

Remove page thumbnails from the PDF file.

Default: False

RemovePageThumbnails
RemoveDuplicates

Optional

Bool

Remove duplicate fonts and color profiles from the PDF file.

Default: False

RemoveDuplicates
RemoveAlternateImages

Optional

Bool

Remove alternate images from the PDF file.

Default: False

RemoveAlternateImages
RemoveNamedDestinations

Optional

Bool

Remove named destinations from the PDF file.

Default: False

RemoveNamedDestinations
RemoveEmbeddedFiles

Optional

Bool

Remove embedded/attachments files from the PDF file.

Default: False

RemoveEmbeddedFiles
Miscellaneous Parameters
Parameter Description Value
CreateObjectStreams

Optional

Bool

Create object streams when compressing 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: False

CreateObjectStreams
Optimize

Optional

Bool

Optimize page content streams in the PDF file.

Default: False

Optimize
LzwToFlate

Optional

Bool

In streams that use LZW encoding, use Flate instead.

Default: False

LzwToFlate
Linearize

Optional

Bool

Linearize compressed PDF file and optimize for fast Web View.

Default: False

Linearize
PreservePdfa

Optional

Bool

Preserve the PDF/A standard when compressing the PDF file.

Default: False

PreservePdfa

Snippets are autogenerated according to converter parameter choices above. Please select file in "File" or "Files" parameter before using code snippets.

Code snippet is using ConvertAPI Node.js Client

Code snippet is using ConvertAPI PHP Client

Code snippet is using ConvertAPI Java Client

Code snippet is using ConvertAPI C# Client

Code snippet is using ConvertAPI Ruby Client

Code snippet is using ConvertAPI Python Client

Code snippet is using ConvertAPI Go Client

Code snippet is using command line utility program