PDF geometry

PDF Page Boxes Explained: MediaBox, CropBox, TrimBox and BleedBox

A PDF page can have several rectangles at once. The one you see is not always the one that defines the physical page.

Why PDF needs more than one page rectangle

PDF was designed for both screen documents and professional print workflows. A single page boundary is not enough to describe every stage of that process. The format therefore allows multiple page boxes, each describing a different intended region. They are coordinates in the page's user space, not instructions to erase content outside them.

The five standard page boxes

BoxPurpose
MediaBoxThe physical medium or full page canvas. It is required and provides the broad page boundary.
CropBoxThe region a viewer should normally display or print. If absent, viewers generally fall back to the MediaBox.
BleedBoxThe region to which page contents should extend when a printed piece needs bleed beyond its final trim edge.
TrimBoxThe intended finished dimensions of a printed page after trimming.
ArtBoxA creator-defined boundary around meaningful artwork or content.

Cropping usually changes visibility, not the underlying page

A non-destructive crop can simply change the CropBox. Objects outside that box may remain in the PDF. If another tool later expands or removes the crop, those objects can become visible again. This is convenient for reversible layout work but it is not a security feature.

Important: never use cropping as a substitute for redaction. If information must be removed, use a workflow that actually removes or irreversibly flattens the sensitive content.

Coordinates can have non-zero origins

Many simple PDFs use a MediaBox that begins at 0,0, but the format does not require that. A page can begin at another coordinate, and inherited boxes can come from the parent page tree rather than appearing directly on the page object. Robust software therefore has to resolve the effective box instead of assuming every page is [0 0 width height].

What about reversed or oversized rectangles?

Real-world PDFs are not always tidy. Rectangle corners can arrive in an unexpected order, and a CropBox may extend beyond the MediaBox. A viewer normally normalises and clips what it considers visible. Editing software has to make the same decision or an annotation overlay can be stretched, mirrored or offset when it is written back to the PDF.

NoblePDF's editor normalises CropBox corners and intersects the visible rectangle with MediaBox before placing a non-destructive annotation overlay. That behaviour was added after deliberately testing reversed-corner and oversized boxes rather than assuming files are well formed.

Rotation adds another coordinate system

The page dictionary can carry a rotation such as 90, 180 or 270 degrees. The underlying PDF coordinates do not simply become screen coordinates. A viewer rotates the page for display, while annotations or overlays written to the PDF need a transform that maps what the user saw back into page space. This is why page geometry bugs often appear only on rotated or cropped PDFs.

How to check a crop safely

  1. Keep an original copy.
  2. Crop a duplicate and reopen it in a second viewer.
  3. Check each edge at high zoom.
  4. If you plan to annotate after cropping, place a temporary mark near each corner and export once.
  5. If the crop is intended to hide sensitive information, stop and use redaction instead.