unityaisolutions/pdf-compressor
A powerful PDF compression tool with image optimization capabilities, built for Replicate.
Run unityaisolutions/pdf-compressor with an API
Use one of our client libraries to get started quickly. Clicking on a library will take you to the Playground tab where you can tweak different inputs, see the results, and copy the corresponding code to use in your own project.
Input schema
The fields you can use to run this model with an API. If you don't give a value for a field its default value will be used.
| Field | Type | Default value | Description |
|---|---|---|---|
|
string
|
PDF file to compress
|
||
| compress_images |
boolean
|
True
|
Compress images within the PDF
|
| image_quality |
integer
|
75
Min: 1 Max: 100 |
JPEG quality for image compression (1-100)
|
| image_max_size |
integer
|
1920
|
Maximum image dimension in pixels (0 = no resize)
|
| remove_metadata |
boolean
|
True
|
Remove PDF metadata to reduce file size
|
| deflate_level |
integer
|
6
Min: 1 Max: 9 |
Flate compression level (1-9, higher = better compression)
|
{
"type": "object",
"title": "Input",
"required": [
"pdf"
],
"properties": {
"pdf": {
"type": "string",
"title": "Pdf",
"format": "uri",
"x-order": 0,
"description": "PDF file to compress"
},
"deflate_level": {
"type": "integer",
"title": "Deflate Level",
"default": 6,
"maximum": 9,
"minimum": 1,
"x-order": 5,
"description": "Flate compression level (1-9, higher = better compression)"
},
"image_quality": {
"type": "integer",
"title": "Image Quality",
"default": 75,
"maximum": 100,
"minimum": 1,
"x-order": 2,
"description": "JPEG quality for image compression (1-100)"
},
"image_max_size": {
"type": "integer",
"title": "Image Max Size",
"default": 1920,
"minimum": 0,
"x-order": 3,
"description": "Maximum image dimension in pixels (0 = no resize)"
},
"compress_images": {
"type": "boolean",
"title": "Compress Images",
"default": true,
"x-order": 1,
"description": "Compress images within the PDF"
},
"remove_metadata": {
"type": "boolean",
"title": "Remove Metadata",
"default": true,
"x-order": 4,
"description": "Remove PDF metadata to reduce file size"
}
}
}
Output schema
The shape of the response you’ll get when you run this model with an API.
{
"type": "array",
"items": {
"type": "string",
"format": "uri"
},
"title": "Output",
"x-cog-array-type": "iterator"
}