← All tools
📐

Crop & Rotate PDF Pages — Custom Margin Crop Online

Trim document margins, crop page dimensions, or rotate upside-down pages in your PDF file. Accurate and secure local tool.

+Upload PDF or photoor drag & drop files here🚀 Launch Tool for Free

How It Works

01

Upload your PDF

Open a PDF document in your browser. No server upload required.

02

Crop or rotate

Set the crop area or rotate the page to your preferred angle.

03

Save the result

Applied changes are baked into the final exported PDF file.

Why pdfredX

🔒

Full Privacy

Files never leave your browser. No upload to third-party servers.

Client-Side Processing

All computations happen locally — fast, secure and free.

🆓

No Registration

Just open your browser and start. No accounts needed.

📱

Works on All Devices

Desktop, tablet, and mobile — no installation required.

Related Articles

How to Rotate and Crop PDF Pages Online: Turn a Sideways Scan and Trim the Margins
A scan came out sideways, a page arrived upside down, a document has wide empty margins or an extra border along the edge. The "Crop & Rotate" tool in pdfredX fixes this right in the browser: you rotate the page in 90° steps and set the crop area with a visual box. Nothing is uploaded to a server.

A scan came out sideways, a page arrived upside down, a document has wide empty margins or an extra border along the edge. The "Crop & Rotate" tool in pdfredX fixes this right in the browser: you rotate the page in 90° steps and set the crop area with a visual box. Nothing is uploaded to a server.


Step 01. Open the page in the editor

Load a PDF or a photo on pdfredx.com — the pages lay out as a gallery. Press the ✎ button on the card of the page you need: the crop and rotate editor opens. Everything is computed locally, the file does not go to a server.


Step 02. Rotate and/or crop

Rotation. The ↺ −90° and ↻ +90° buttons turn the page in 90° steps: that's how you fix a sideways scan or an upside-down sheet. Two presses give 180°. On rotation the canvas automatically adjusts to the new size, with a white background.

Cropping. Drag the crop box to cut off margins, the scanner frame or an extra edge. Aspect-ratio presets are available:

  • Auto-A4 — fits the area to A4 proportions.
  • A4 / A3 / Letter / Legal — fixed ratios for standard formats.
  • Free — an arbitrary box with no ratio constraint.

A scale badge shows the current percentage — handy so you don't crop too small.


Step 03. Apply and save

Press "Apply" — the crop and rotation are baked into the page (the editUrl is updated). The result shows in the gallery at once. When all pages are ready, "Create PDF" assembles the final file. The download goes straight from the browser. Free, no registration, no server queue.


How it works under the hood

Rotation and cropping work over the page image. The rotation buttons call doRot(±90), and the rotCanvas function redraws the page onto a new canvas at the required angle (the dimensions are recomputed, the background filled white). After a rotation the Cropper.js crop editor restarts with the already-rotated image.

Cropping is applied through getCroppedCanvas: the area selected by the box is cut into a new canvas, and the result becomes the page's new editUrl. The original (origUrl) is not changed in the process — edits always go into a separate field, so you can reopen the editor and continue.


Known limitations

Rotation in 90° steps. The tool turns sideways and flipped pages (90°/180°/270°). There is no fine "straighten by a couple of degrees" slider here — for a slightly tilted scan, use the crop box to align the frame to the edge.

The result is raster. Applied changes are baked into the page image; text in the final file can't be selected, and links and bookmarks are not carried over (a general property of the export).

Editing page by page. Crop and rotation are applied to one page at a time through its ✎ button. Bulk rotation of all pages at once is not yet available.


Need to rearrange pages rather than rotate them? That is the Reorder Pages tool. And to combine several files into one — Merge PDF.

Try it right now — pdfredx.com, no registration, your files stay with you.

How to Fix a Sideways or Upside-Down Scan and Trim Crooked PDF Margins Without Uploading the File
The scanner produced sideways pages, the phone shot the document upside down, and along the edges there's a black border and extra margins from the glass. Such a PDF is awkward to read and embarrassing to send. An ordinary online rotate-and-crop service asks you to upload the document to its server, even though this is a purely visual edit. And if it's a scan of a passport, a contract or a medical certificate — a confidential document travels to someone else's machine just for a 90° turn. Let's look at how to fix the pages locally.

The scanner produced sideways pages, the phone shot the document upside down, and along the edges there's a black border and extra margins from the glass. Such a PDF is awkward to read and embarrassing to send. An ordinary online rotate-and-crop service asks you to upload the document to its server, even though this is a purely visual edit. And if it's a scan of a passport, a contract or a medical certificate — a confidential document travels to someone else's machine just for a 90° turn. Let's look at how to fix the pages locally.


What's usually wrong with scans

  • Sideways orientation. The scanner or camera turned the sheet 90° — the text runs vertically.
  • Upside down. The page was placed the wrong way up — a 180° turn is needed.
  • Extra margins and a border. Along the edges there's the scanner-glass margin, a shadow or a black frame you want to trim off.

All of this is fixed by rotating in 90° steps and cropping with a box — with no server processing at all.


Local editing: the document never leaves the tab

pdfredX rotates and crops pages without uploading the file anywhere. That is a consequence of the architecture, and you can verify it.

The file is read locally. The page opens in the editor inside the tab; there is no network request carrying your document.

Rotation and cropping happen in the tab's memory. 90°/180° turns, choosing the crop area, applying — all of these are operations on data that is already loaded. Nothing is sent anywhere.

Only the corrected file is downloaded. The finished PDF is assembled on the client and lands in "Downloads," rather than flying to a server and back.

It works offline. Load the scan, turn off the internet and fix the pages — everything keeps working. The network is only needed to load the app once.

In practice: press ✎ on the crooked page, use the ↺ −90° / ↻ +90° buttons to set it straight, trim the margins and the scanner frame with the box, then "Apply." The document stays with you the whole time.


Honestly about the tool's limits

Rotation in 90° steps. Sideways and upside-down scans straighten perfectly. But if the sheet was placed with a slight tilt of a couple of degrees, there is no separate "nudge by 3°" slider here — such a skew is partly masked by cropping the frame to the edge with the crop box.

Editing page by page. Each page is fixed through its own ✎ button; a bulk turn of all pages with one press is not yet available.


What we cannot guarantee — an honest disclaimer

Client-side processing protects a document from being sent to external servers, but it is not a shield against every threat.

Malware or a keylogger on the device. If the machine is compromised, a program can read files off the disk bypassing the browser entirely.

Browser extensions with broad permissions. An extension with "read data on all sites" access can, in theory, see the tab's contents. For sensitive documents, work in a profile without third-party extensions or in a private window.

The saved file stays on your disk. If the device is not protected by encryption, files can be read by third parties with physical access.

We provide isolation at the level of the browser tab. The rest is on the user's side.


Straighten and trim a scan without uploading it to a server — pdfredx.com, free, no registration.

How Page Rotation and Cropping Work in the Browser: rotCanvas, Cropper.js, and Baking into editUrl
You can rotate and crop a PDF page on a server through the transformation matrix (CTM) right in the file structure, without rasterizing the content. In the browser, within the app's shared raster pipeline where a page is already reduced to an image, a different path is chosen. Let's break down how the "Crop & Rotate" (`crop`) tool in pdfredX is built: why rotation is drawn on canvas, how Cropper.js handles cropping only, and why the changes are baked into a separate `editUrl` field.

You can rotate and crop a PDF page on a server through the transformation matrix (CTM) right in the file structure, without rasterizing the content. In the browser, within the app's shared raster pipeline where a page is already reduced to an image, a different path is chosen. Let's break down how the "Crop & Rotate" (crop) tool in pdfredX is built: why rotation is drawn on canvas, how Cropper.js handles cropping only, and why the changes are baked into a separate editUrl field.


The architectural choice: CTM in the structure vs. canvas rasterization

The transformation matrix (CTM). The "server" way is to write the rotation and crop as a transformation in the PDF structure: the content stays vector and sharp. But that requires a PDF parser and careful work with coordinate spaces.

Canvas rasterization (the pdfredX path). The page is already rendered by PDF.js into an image. Rotation is performed by redrawing that image onto a new canvas, and cropping by cutting the area into yet another canvas. The price is a raster result; the gain is predictability and privacy (everything in the tab, the file goes nowhere).


The implementation, piece by piece

Rotation: doRot → rotCanvas

The rotation buttons accumulate the angle and redraw the page:

async function doRot(deg) {
  eRot = (eRot + deg + 360) % 360;      // accumulate the angle (buttons give ±90)
  const rotated = await rotCanvas(eBase, eRot);
  loadCropper(rotated);                 // restart the crop editor with the rotated image
}

The rotation itself is done by rotCanvas: it recomputes the rotated canvas's dimensions via sine/cosine, fills the background white and draws the image at the required angle:

const rad = degrees * Math.PI / 180;
const cw = Math.round(img.width*cos + img.height*sin);  // new bbox dimensions
const ch = Math.round(img.width*sin + img.height*cos);
ctx.fillStyle = '#fff'; ctx.fillRect(0, 0, cw, ch);      // white background under the "corners"
ctx.translate(cw/2, ch/2); ctx.rotate(rad);
ctx.drawImage(img, -img.width/2, -img.height/2);

An important detail: the dimension formula and the background fill are written for any angle, so the function can mathematically handle an arbitrary rotation too — but in the UI it is called in 90° steps (↺ −90° / ↻ +90°). The white fill is needed so the "corners" that appear on a non-90° rotation don't turn black.

Cropping: Cropper.js for cropping only

The Cropper.js editor is initialized with its own rotation disabled — rotation is done by rotCanvas, and Cropper is responsible only for the crop box:

cropper = new Cropper(img, {
  viewMode: 1, autoCropArea: 1,
  rotatable: false, scalable: false,   // Cropper's rotation and scaling are off
  cropBoxMovable: true, cropBoxResizable: true,
});

Aspect-ratio presets are set through setAspectRatio (A4/A3/Letter/Legal from the PAGE_RATIOS table, auto-A4 mode, or NaN for a free box). On restart after a rotation the active preset is restored so the box doesn't "slip."

Baking into editUrl

Applying cuts the selected area and saves it as the page's new editUrl:

const croppedCanvas = cropper.getCroppedCanvas({ ... });
items[eId].editUrl = croppedCanvas.toDataURL();  // edits go into editUrl only

The key invariant: origUrl (the original) is never mutated, edits go only into editUrl. So the editor can be reopened and continued from the current state, and later tools (annotations, watermark) work with the already cropped/rotated page.


Trade-offs and the limits of the approach

A raster result. There is no vector sharpness at strong zoom; for an on-screen document and printing the difference is minimal.

Rotation in 90° steps in the UI. The engine (rotCanvas) supports any angle, but the interface only offers 90° steps; a fine deskew slider for an arbitrary degree is not yet available.

Editing page by page. One editor call — one page; there is no bulk rotation of all pages at once.


What's next

A fine-rotation slider — set an arbitrary angle (±15° in 0.5° steps) to straighten slightly tilted scans; the rotCanvas engine already allows this, a UI control is needed.

Batch rotation — apply one turn to all selected pages at once.


Want to test it — load a crooked scan on pdfredx.com, open it with the ✎ button, rotate and crop. No registration, no file upload to a server.

🚀 Launch Tool for Free