PDF

PDF Compression API

Shrinks a PDF by resampling each image to the size it is shown at on the page.

Every image in the document is resampled by the size it is actually displayed at, not by a blanket setting. The response reports the original size, the output size and the ratio. If the output is not smaller, you get your original back and the charge is $0.00. No AI in the pipeline.

What it does

  • Resamples each image by the size it is shown at on the page
  • Presets for screen, email, ebook, print and prepress, or "auto" to pick from the document itself
  • Synchronous under 10 MB; larger files run in the background with an optional webhook
  • Returns your original file and charges $0.00 when the output is not smaller
  • Never charged on a 4xx or a 5xx

Endpoints

MethodPathDescriptionModes
POST /v1/pdf/compress Compress a PDF sync, async (sync: input under 10 MB)

Base URL: https://api.justapi.tech

Pricing

OperationPrice
Compress, up to 25 MB$0.030per document, first 1,000 a month; then $0.025, and $0.020 over 10,000
Compress, 25 to 200 MB$0.060per document, first 1,000 a month; then $0.050, and $0.040 over 10,000
Quality verification (SSIM)+$0.008per document, first 1,000 a month; then $0.006, and $0.005 over 10,000

You are not charged for a failed request, and never for a job whose output is not smaller than its input.

Limits

Max File Size200 MB
Result RetentionDeleted automatically within 24 hours, or at once when you acknowledge the download

How it decides

The engine uses each image's displayed size on the page to decide whether to resample it. Choose a profile for screen, email or print, then inspect the output with representative files. The response reports original and output bytes, pages, images processed and whether the original was returned. See the photo report integration guide for the size calculations and a proposed acceptance checklist. For request code in Node.js and Python, with retries and the job wait, read compress a PDF from Node.js and Python.

Target a size, not a guess

If your real constraint is an email attachment limit, say so directly:

{
  "source": { "url": "https://example.com/report.pdf" },
  "options": { "max_base64_bytes": 28000000, "output": "base64" }
}

The engine tries quality and resolution settings above its configured quality floor. A target can remain unmet: check stats.target_not_met. Padded base64 has 4 * ceil(bytes / 3) characters, before message headers, line wrapping or other attachments. Budget for the complete payload.

Safe by default

Detected signatures and PDF/A or PDF/X declarations are rejected by default. These checks do not replace a signature or conformance validator. Do not override them without deciding whether you need a signed record, a compliant archive or a separate delivery copy.

Read the endpoint reference and signed PDF error guide before connecting a production workflow. Some accepted advanced fields are not consumed by the current native engine; this page does not promise font subsetting, JBIG2 or SSIM verification.