Stirling PDF icon

Stirling PDF

Merged API: Stirling PDF - Processing API + Stirling PDF - Management API + Stirling PDF - System API

Actions260

General → Crop Pdf

AI-generated

Summary

Crop a PDF file by specifying the crop area's coordinates and dimensions or by enabling auto-crop to remove white space. Optionally remove text data outside the crop area while preserving images.

Inputs

  • Input Binary Field Name (File Input) — Name of the binary property containing the PDF file data if providing the file directly in the workflow input.
  • File Id — ID of a previously uploaded server-side PDF file to operate on instead of a binary input.
  • X — X-coordinate of the top-left corner of the crop area.
  • Y — Y-coordinate of the top-left corner of the crop area.
  • Width — Width of the crop area.
  • Height — Height of the crop area.
  • Remove Data Outside Crop — Whether to remove text data outside the defined crop area, keeping images intact.
  • Auto Crop — Enable automatic detection and removal of white space margins from the PDF.

Output shape

A PDF file with the defined crop applied, returned in binary format suitable for further workflow use or storage.

Either a binary file input or a file ID must be provided. Crop dimensions (X, Y, Width, Height) are optional if Auto Crop is enabled. If Remove Data Outside Crop is set, text outside the crop area is removed but images remain. The operation supports asynchronous processing if a file ID is used from a previous async job.

Examples

Example 1: Crop a PDF content area precisely

Specify X, Y, Width, Height to crop a PDF file binary uploaded in the workflow.

Example 2: Automatically crop PDF to remove all whitespace margins

Enable Auto Crop without providing explicit crop coordinates.

Links

Discussion