pdf_compress_size
Shrink a PDF to a size you need, for example under 2 MB (the site's File size mode). Runs Balanced, Aggressive and Extreme gentlest first and stops at the first that fits; otherwise returns the smallest file with targetMet: false and limitReason. limit caps how far it goes (balanced keeps text selectable). Slow at stronger limits; returns the best level so far (truncated: true) on timeout. A PDF already under the goal comes back unchanged.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"fileBase64": "<fileBase64>",
"targetSize": "<targetSize>"
},
"name": "pdf_compress_size"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | How far the steps may go. Default extreme. balanced = text stays selectable; aggressive = pages may become pictures; extreme = greyscale and black-and-white too | |
| fileBase64 | Yes | The PDF, base64 encoded (up to 20 MB, up to 100 pages) | |
| targetSize | Yes | The size to reach: a number of bytes, or text such as 2MB or 500KB |