Crop and Resize PDF Pages

Set the top, right, bottom and left margin in millimeters to shrink the visible area of the selected pages, or fit them onto A4, Letter, Legal or their original page size. Cropping moves the crop box only: the media box stays and the content outside the new box remains in the file.

Runs locally in your browser
·
    PDF

    How to crop PDF margins or fit selected pages to a paper size

    Cropping sets a new crop box on the pages you name: the media box and the page size are left as they were, and the content outside the new box stays in the file. Fitting rebuilds those pages on A4, Letter, Legal or their original page size and draws the original page inside the outer margin you set.

    The work runs in the browser with pdf-lib; the file is not uploaded. Pages left out of the page field keep their size and their own crop box, and every run starts from the file as you loaded it, so pressing the button twice gives the same output twice.

    1. Drop a PDF in or choose one; the tool takes one file and rejects anything that is not a PDF.
    2. Pick Crop margins to trim the visible area, or Fit content to a page size to redraw the selected pages on A4, Letter, Legal or the original page size.
    3. Enter the pages the change applies to, for example 1-3,5, or leave the field empty for every page. A page number outside the document stops the run.
    4. For cropping, set top, right, bottom and left in millimeters. For fitting, choose the paper size and orientation and set the outer margin.
    5. Press Apply page changes and check the three counts: pages changed, input size and output size. The download is named after the input with -cropped.pdf or -resized.pdf; Clear empties the file and puts the fields back as they were served.

    Which box the crop changes, which pages are touched, and what the errors mean

    Cropping changes the crop box, not the page

    With 20 mm on all four sides of an A4 page the output carries a crop box of 56.69, 56.69, 481.89 × 728.5 pt while the media box stays 595.28 × 841.89 pt: the trimmed strip is still in the file and a viewer that ignores the crop box can show it.

    Margins are measured from the current crop box and are not rotated with the page. A page carrying /Rotate 90 was trimmed by the same top, right, bottom and left in unrotated coordinates and kept its 90°; a page that already had a crop box of 50, 60, 495.28 × 721.89 pt was trimmed further inside it, to 78.35, 88.35, 438.59 × 665.2 pt.

    Selected pages, mixed page sizes and the 24 pt floor

    The page field takes one number, a range or a list: 1-3,5 on a five-page file cropped exactly those pages, and the other pages kept their original crop box. Each selected page is trimmed inside its own box, so a file holding A4 portrait, A4 landscape, Letter and a 200 × 200 pt page came back with all four sizes intact.

    A margin that would leave less than 24 pt (8.5 mm) in either direction stops the run with a sentence, as does a negative millimetre value; neither writes a broken page. 50 mm on all four sides of a 300 × 400 pt page is refused, and an empty field means 0 mm.

    Fitting to a paper size

    Fitting copies the document and redraws only the selected pages at 595.28 × 841.89 pt (A4), 612 × 792 pt (Letter) or 612 × 1008 pt (Legal), swapped for landscape. Orientation auto keeps a landscape source page landscape: an A4 landscape page stayed 841.89 × 595.28 pt, and a 200 × 200 pt page took the portrait paper size. Original page size keeps the source dimensions and still applies the outer margin.

    Pages that were not selected keep their own size, and the outer margin is the white frame around the drawing. An outer margin larger than half the page in either direction is refused with its own sentence instead of being clamped to a sliver. An encrypted file answers with the encryption notice, an empty, truncated or non-PDF file answers with a plain sentence instead of the parser report, and pressing the button with no file says so.

    Recent tools: