ForHosting KIT · Documents & PDF

Crop PDF pages

Plan a PDF crop before changing the document itself. Supply each page's original width and height together with a crop box measured in PDF points, and this calculator returns the resulting dimensions for every page.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

It also checks that each crop rectangle stays inside its source page, so invalid geometry is caught before it reaches a PDF library, print workflow, or document-processing pipeline. The calculation is deterministic and works with mixed page sizes in one request.

Describe every page and crop box in PDF points

A PDF page is measured in points, where 72 points equal one inch. For each page, provide the original width and height, then describe the crop rectangle with crop_x, crop_y, crop_width, and crop_height. The x coordinate starts at the left edge and the y coordinate starts at the bottom edge, matching the conventional PDF coordinate system. The crop width and height are the dimensions that remain visible, not margins to subtract. For example, a US Letter page is commonly 612 by 792 points. A crop box beginning at 36, 54 with a width of 540 and height of 684 fits inside that page and produces a 540 by 684 point result. List pages in document order. The response assigns page numbers from that order, which makes it straightforward to join the calculated geometry back to a PDF inspection report or processing job. Mixed portrait, landscape, and custom sizes can appear in the same request.

Understand the boundary checks

Every original dimension and every crop-box component must be a finite number. Original page dimensions and crop dimensions must be greater than zero, while crop origins may be zero but cannot be negative. The calculator verifies the right boundary by checking crop_x plus crop_width against the original width. It verifies the top boundary in the same way, using crop_y plus crop_height and the original height. If either boundary goes beyond the source page, the request fails with an invalid-input error that identifies the page. Touching an outer edge exactly is valid: a crop rectangle may end at the page width or page height without exceeding it. These checks are useful because a rectangle can have reasonable-looking dimensions while still be displaced outside the page by its origin. Validation occurs for all supplied pages, so one invalid page stops the result instead of leaving a partially usable set of dimensions.

Use the calculated dimensions in a PDF workflow

The result reports the original size, crop origin, and new width and height for each page. It does not rewrite or upload a PDF; it calculates and validates the page geometry that a PDF editor or library can apply. That separation is helpful when you need to preview changes, validate user-entered crop settings, estimate downstream layout, or normalize instructions before an expensive document job begins. You can convert the returned dimensions to inches by dividing by 72, although keeping points avoids rounding while working with PDF tools. When pages share a size and crop rule, repeat the corresponding values for each page so the output remains explicitly aligned with document order. Before applying the crop, confirm whether your PDF library expects an x/y/width/height rectangle or left/bottom/right/top coordinates. For the latter form, calculate right as crop_x plus new_width and top as crop_y plus new_height. The API price is $0.002 per request.

Validate crop settings before processing

Reject a document job early when any requested crop rectangle extends beyond its source page.

Preview mixed-size PDF output

Calculate the resulting dimensions for portrait, landscape, and custom pages in one ordered response.

Prepare geometry for a PDF library

Turn checked page and crop measurements into reliable inputs for a separate PDF editing step.

Does this capability modify the PDF file?

No. It validates crop geometry and calculates the resulting page dimensions; a separate PDF tool can apply those values.

What units should I use?

Use PDF points for original dimensions, crop origins, and crop dimensions. There are 72 points in one inch.

Where is the crop-box origin?

crop_x is measured from the left edge and crop_y from the bottom edge of the original page.

Can a crop box touch the page boundary?

Yes. A crop box may end exactly at the original width or height, but it cannot extend beyond either boundary.

Can one request contain different page sizes?

Yes. Each page carries its own original dimensions and crop box, so mixed page sizes are supported.

What does it cost?

The API costs $0.002 per request, and the same deterministic calculation can run free in the browser.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/pdf/crop-pages

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/pdf/crop-pages \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"pages":[{"width":612,"height":792,"crop_x":36,"crop_y":54,"crop_width":540,"crop_height":684},{"width":842,"height":595,"crop_x":20,"crop_y":15,"crop_width":800,"crop_height":560}]}'
{
  "pages": [
    {
      "width": 612,
      "height": 792,
      "crop_x": 36,
      "crop_y": 54,
      "crop_width": 540,
      "crop_height": 684
    },
    {
      "width": 842,
      "height": 595,
      "crop_x": 20,
      "crop_y": 15,
      "crop_width": 800,
      "crop_height": 560
    }
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "pdf.crop_pages",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb25
max_pages200
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →