RadarPricesOrder

Home › APIs › PDF & documents

PDF & documents

PDF Crop API

In plain words

Cuts the white edges off PDF pages.

Used by: Office staff, accountants, students and apps that handle PDF files.

Cut white margins off every page automatically, or crop top/bottom/left/right by millimetres. Runs on our server, files are deleted right after the call, nothing stored.

Try it live, no sign-up

Run the example as is, or change the input. 5 own tries a day without a key.

Example request

curl -X POST https://radarbg.com/v1/pdf-crop \
  -H "X-API-Key: YOUR_KEY" -H "Content-Type: application/json" \
  -d '{"fileName": "sample.pdf", "fileContent": "JVBERi0xLjMKJenr8b8KMSAwIG9iago8PAovQ291bnQgMQovS2lkcyBbMyAwIFJdCi9NZWRpYUJveCBbMCAwIDU5NS4yOCA4NDEuODldCi9UeXBlIC9QYWdlcwo+PgplbmRvYmoKMiAwIG9iago8PAovT3BlbkFjdGlvbiBbMyAwIFIgL0ZpdEggbnVsbF0KL1BhZ2VMYXlvdXQgL09uZUNvbHVtbgovUGFnZXMgMSAwIFIKL1R5cGUgL0NhdGFsb2cKPj4KZW5kb2JqCjMgMCBvYmoKPDwKL0NvbnRlbnRzIDQgMCBSCi9QYXJlbnQgMSAwIFIKL1Jlc291cmNlcyA2IDAgUgovVHlwZSAvUGFnZQo+PgplbmRvYmoKNCAwIG9iago8PAovRmlsdGVyIC9GbGF0ZURlY29kZQovTGVuZ3RoIDExMgo+PgpzdHJlYW0KeJwzUvDiMtAzNVco53IKUdB3M1QwNNIzMFAISVNwDQEJGRvqGVoomFua6pmbK4SkKGh45pXlZyanKhgZGJnpGhgYKrhWJOYW5KQq+JSkaCqEZKHqMzPXMzEC6wvJL0nMAZpuADLeNTQIphYAsdgfAQplbmRzdHJlYW0KZW5kb2JqCjUgMCBvYmoKPDwKL0Jhc2VGb250IC9IZWx2ZXRpY2EKL0VuY29kaW5nIC9XaW5BbnNpRW5jb2RpbmcKL1N1YnR5cGUgL1R5cGUxCi9UeXBlIC9Gb250Cj4+CmVuZG9iago2IDAgb2JqCjw8Ci9Gb250IDw8L0YxIDUgMCBSPj4KL1Byb2NTZXQgWy9QREYgL1RleHQgL0ltYWdlQiAvSW1hZ2VDIC9JbWFnZUldCj4+CmVuZG9iago3IDAgb2JqCjw8Ci9DcmVhdGlvbkRhdGUgKEQ6MjAyNjExMTUyMDEzNTRaKQo+PgplbmRvYmoKeHJlZgowIDgKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDE1IDAwMDAwIG4gCjAwMDAwMDAxMDIgMDAwMDAgbiAKMDAwMDAwMDIwNSAwMDAwMCBuIAowMDAwMDAwMjg1IDAwMDAwIG4gCjAwMDAwMDA0NjkgMDAwMDAgbiAKMDAwMDAwMDU2NiAwMDAwMCBuIAowMDAwMDAwNjUzIDAwMDAwIG4gCnRyYWlsZXIKPDwKL1NpemUgOAovUm9vdCAyIDAgUgovSW5mbyA3IDAgUgovSUQgWzwyMzc0NENDOUY1ODJDN0FCMkFGMjQ5MDVFRTQ3RjgzNz48MjM3NDRDQzlGNTgyQzdBQjJBRjI0OTA1RUU0N0Y4Mzc+XQo+PgpzdGFydHhyZWYKNzA4CiUlRU9GCg==", "mode": "auto"}'

Answer: {"ok": true, "count": N, "items": [...], "usage": {...}}. Failed calls are not counted.

Inputs

FieldTypeDescription
fileContentstringThe file as base64 (a data: URI is fine)
fileNamestringFile name with extension, e.g. report.pdf
filesarrayOr several files: [{fileName, fileContent (base64)}]
modestringauto (detect margins) or mm (your values)
topnumberTop mm (mode=mm)
bottomnumberBottom mm (mode=mm)
leftnumberLeft mm (mode=mm)
rightnumberRight mm (mode=mm)
sameOnAllPagesbooleanUse one crop box for every page (mode=auto)

Price

Included in every plan: 500 calls a month free, then from €9 a month for 5,000 calls across all APIs. Pro, €29 for 25,000 calls, is the one we recommend.

Questions

What does the PDF Crop API do?

Cuts the white edges off PDF pages.

Where does the data come from?

Cut white margins off every page automatically, or crop top/bottom/left/right by millimetres. Runs on our server, files are deleted right after the call, nothing stored.

How much does it cost?

500 calls a month are free with no card. Paid plans start at EUR 9 a month for 5,000 calls and include every API on Radar. Failed calls are not counted.

Can I use it without writing code?

Yes. Try it live on this page, use our free browser tools, or ask us to run it on your list as a service.

Related APIs

Excel to PDF APITurns an Excel or CSV sheet into a PDF that prints well.
Image to Text OCRReads the text from a photo or a scanned PDF, so you can copy and search it.
Images to PDF APIPut many photos or scans into one PDF, one picture per page.
PDF Compress APIMakes a PDF smaller so it fits in an e-mail or upload form.
PDF Flatten APILocks the filled-in fields and notes of a PDF so nobody can change them.
PDF Merge APIJoins several PDF files into one, in the order you want.