Skip to content
PDF Manipulation API

Crop PDF API

Trim PDF pages to remove borders, margins, and unwanted whitespace programmatically. Perfect for preparing scanned documents, cleaning up exports, and ensuring print-ready output every time.

8,700+
Teams using xspdf
260ms
Median crop time
99.95%
Success rate
cURL
curl -X POST "https://api.xspdf.com/v1/manipulate/crop" \
  -H "Authorization: Bearer $API_KEY" \
  -d '{"input_url":"https://files.example.com/scan.pdf","options":{"margin_top":10,"margin_bottom":10,"margin_left":15,"margin_right":15,"unit":"mm"}}'
260ms
Average crop time for standard documents
99.95%
Uptime SLA with automatic failover
11 million
Pages cropped for print workflows monthly
SOC 2
Certified with encrypted storage

Manual PDF cropping wastes hours and kills quality

Print shops reject PDFs with bad margins. Scanned documents have ugly borders. Teams waste time manually cropping in Acrobat or Illustrator.

Manual cropping is tedious

Open PDF, select crop tool, adjust margins page by page, save. Got 500 scanned invoices? That's an entire day of mind-numbing work.

Inconsistent margins ruin print jobs

Manual cropping leads to uneven margins. Print shops reject files. You reprint at 2x cost. Customers wait longer. Everyone loses.

No automation for bulk operations

Need to crop 10,000 scanned receipts with uniform margins? Acrobat Actions crash. Third-party tools have upload limits. You're stuck doing it manually.

The hidden cost of manual cropping

Staff time spent cropping documents: 10+ hours/week. Rejected print jobs from bad margins: 5-10% of orders. Revenue lost from reprints and delays: Thousands per quarter.

Perfect margins in 260ms. Print-ready every time.

260ms average crop time

Upload PDF URL, specify margins in mm/inches/points. Get back perfectly cropped pages. Auto-detect or manual control. Batch process thousands without clicking.

Preserves content and quality

No re-rendering, no quality loss. We mathematically adjust page boundaries without touching your content. Text stays crisp, vectors stay sharp.

Enterprise-grade security

SOC 2 certified. Files encrypted at rest and in transit. Auto-deleted after 24 hours. GDPR compliant with EU data residency options.

500 operations free every month. No credit card required. See FAQ

Python
import requests

API_KEY = "your_api_key"

response = requests.post(
    "https://api.xspdf.com/v1/manipulate/crop",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={
        "input_url": "https://files.example.com/scan.pdf",
        "options": {
            "margin_top": 10,
            "margin_bottom": 10,
            "margin_left": 15,
            "margin_right": 15,
            "unit": "mm"
        }
    }
)

cropped_url = response.json()["output_url"]
print(f"Cropped PDF ready: {cropped_url}")

Built for print workflows and document automation

Everything you need to crop, clean, and perfect PDF margins at scale.

Custom margins per edge

Set independent margins for top, bottom, left, and right edges. Use millimeters, inches, or points. Perfect for bleed trimming and print prep.

Auto-detect whitespace

Automatically detect and trim excessive whitespace from scanned documents. Preserves content while removing borders and scanner artifacts.

Per-page or batch cropping

Crop all pages uniformly or specify different margins for individual pages. Perfect for mixed documents with varying layouts.

Webhook notifications

Get notified when crop operation completes. Perfect for async workflows and batch processing pipelines.

Usage analytics dashboard

Track crop volumes, success rates, and API latency. Monitor costs and optimize your integration.

Auto-expiring CDN URLs

Files served from global CDN with optional expiration. Download or stream directly. Full control over retention policies.

Frequently asked questions

Does cropping reduce PDF quality?

No. We adjust page boundaries mathematically without re-rendering content. Text, images, and vectors remain pixel-perfect identical to the original.

Unlike screenshot-based cropping or rasterization, our API preserves all PDF objects, fonts, and metadata. Output files are print-ready with no quality loss.

Can I auto-detect and remove whitespace?

Yes. Set auto_detect: true and we'll automatically detect content boundaries and remove excess whitespace.

Perfect for cleaning up scanned documents, exports from design tools, or PDFs with inconsistent margins. You can also combine auto-detection with manual margin adjustments.

How fast is the crop process?

Median crop time is 260ms for standard documents. Very large PDFs (500+ pages) may take 1-2 seconds.

All requests are processed in real-time. Use webhooks for async workflows if you need to crop thousands of documents without blocking.

Do you store my PDF files permanently?

No. Input PDFs and output files are automatically deleted after 24 hours. You can configure shorter retention periods or request immediate deletion after download.

All files are encrypted at rest and in transit. We're SOC 2 certified and GDPR compliant. Enterprise plans include custom retention policies and private storage regions.

What SDKs and languages do you support?

Official SDKs for Python, Node.js, Ruby, PHP, Go, and Java. REST API works with any language that can make HTTP requests.

All SDKs include TypeScript support, automatic retries, and built-in error handling. Check our docs for code examples and integration guides.

Start cropping PDFs in 5 minutes

500 free operations every month. No credit card required. Scale to millions with transparent pricing.