Compress Pdf Pn

Input

NameDescriptionRequired
PDF URLProvide the URL to the source PDF document, or a filetoken:// link from PDF.co Built-In Files Storage. If you use another cloud service such as Google Drive or Dropbox ensure the link is publicly accessible.Yes
File NameFile name for the generated output, the input must be in string format.No
Webhook URLThe callback URL or Webhook used to receive the output data.No
PasswordThe password of the password-protected PDF fileNo
HTTP UsernameHTTP auth user name if required to access source URL.No
HTTP PasswordHTTP auth password if required to access source URL.No
Custom Compression ConfigurationConfiguration options. By default this object is pre-defined to give typical options for optimization.No

Custom Compression Configuration

The config object defines granular settings for the compression process. By default, this config object is set to match the standard configuration for image optimization by Adobe Acrobat Pro and is defined as follows:
{
   "images": {
       "color": {
           "skip": false,
           "downsample": {
               "skip": false,
               "downsample_ppi": 150,
               "threshold_ppi": 225
           },
           "compression": {
               "skip": false,
               "compression_format": "jpeg",
               "compression_params": {
                   "quality": 60
               }
           }
       },
       "grayscale": {
           "skip": false,
           "downsample": {
               "skip": false,
               "downsample_ppi": 150,
               "threshold_ppi": 225
           },
           "compression": {
               "skip": false,
               "compression_format": "jpeg",
               "compression_params": {
                   "quality": 60
               }
           }
       },
       "monochrome": {
           "skip": false,
           "downsample": {
               "skip": false,
               "downsample_ppi": 300,
               "threshold_ppi": 450
           },
           "compression": {
               "skip": false,
               "compression_format": "ccitt_g4",
               "compression_params": {}
           }
       }
   },
   "save": {
       "garbage": 4
   }
}
Refer to this guide for more details on the config object.

Output

NameDescription
jobIdUnique identifier for the background job.
pageCountNumber of pages in the PDF document.
errorIndicates whether an error occurred (false means success)
statusStatus code of the request (200, 404, 500, etc.). For more information, see Response Codes.
creditsNumber of credits consumed by the request
remainingCreditsNumber of credits remaining in the account
durationTime taken for the operation in milliseconds
urlDirect URL to the final PDF file stored in S3.
nameName of the output file
outputLinkValidTillTimestamp indicating when the output link will expire