Changing a PDF’s “margins” can mean three different things: hiding page edges, adding blank page area around existing content, or moving or scaling the content itself. Choose the operation that matches the result you want: a crop changes what is visible; genuine whitespace requires a larger canvas and repositioned content. Python libraries such as PyMuPDF and pypdf expose these as distinct page operations.
Choose the result you want before changing the PDF
- Crop the visible page: adjust the page’s visible boundary. This does not add whitespace, and material beyond the boundary may remain in the PDF.
- Add whitespace: make a larger destination page, then place the original content within it. Choose whether to preserve the content’s size or scale it.
- Move or scale content: transform the page content itself. This is separate from changing the page canvas.
These distinctions matter because a PDF page has page boxes that define its boundaries, while the content is positioned within those bounds. Changing one does not necessarily move or resize the other.
As an Amazon Associate I earn from qualifying purchases.
Crop the visible margins
With PyMuPDF, use Page.set_cropbox() to set the rectangle that should remain visible. The rectangle must be finite, non-empty, and contained within the page’s MediaBox, as described in the PyMuPDF Page documentation. This narrows the visible area; it does not create a border of white space around the remaining content.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11pypdf offers page-box adjustments for cropping. Its cropping and transformation guide explains that cropping adjusts the viewbox: content outside the visible area is not necessarily deleted and may be revealed again if the page bounds are changed later. Treat a crop as a visibility change, not secure redaction or guaranteed removal of content.
#1 Best Overall
- Scanner type: Document
- Connectivity technology: USB
- With Auto Scan Mode, the scanner automatically detects what you're scanning
- Digitize documents and images
Add real whitespace around existing content
To add white space, create or enlarge a destination page and place the existing page content inside it with the desired offset. The canvas and content placement must be handled together: changing only a CropBox cannot add page area. pypdf’s guide distinguishes scaling page content from scaling the page canvas and demonstrates page-box adjustments and transformations; placing content onto a larger page requires the additional step of merging or positioning the transformed page.
Preserve the content size
Use this when the existing text, diagrams, and images should remain the same size. Make the destination page larger, then translate the existing content inward so space appears at the chosen edges. Check that the resulting page boxes describe the new page area rather than cropping it back down.
Rank #2
- FAST SPEEDS - Scans color and black and white documents a blazing speed up to 16ppm (1). Color scanning won’t slow you down as the color scan speed is the same as the black and white scan speed.
- ULTRA COMPACT – At less than 1 foot in length and only about 1. 5lbs in weight you can fit this device virtually anywhere (a bag, a purse, even a pocket).
- READY WHENEVER YOU ARE – The DS-640 mobile scanner is powered via an included micro USB 3. 0 cable allowing you to use it even where there is no outlet available. Plug it into you PC or laptop and you are ready to scan.
- WORKS YOUR WAY – Use the Brother free iPrint&Scan desktop app for scanning to multiple “Scan-to” destinations like PC, Network, cloud services, Email and OCR. (2) Supports Windows, Mac and Linux and TWAIN/WIA for PC/ICA for Mac/SANE drivers. (3)
- OPTIMIZE IMAGES AND TEXT – Automatic color detection/adjustment, image rotation (PC only), bleed through prevention/background removal, text enhancement, color drop to enhance scans. Software suite includes document management and OCR software. (4)
Scale the content to fit
Use this when the content should become smaller as the canvas grows, or when you need it to fit within a target page size. Apply a content transformation as well as setting the destination page dimensions. The pypdf guide treats content scaling and page scaling as different operations, so decide which should change before applying a transformation.
Account for units, page boxes, and rotation
Inspect each page’s dimensions and rotation before applying coordinates across a document. A value that describes an edge or offset must be expressed in the coordinate system expected by the library, and page boxes must remain consistent with the intended visible and physical page area.
Rank #3
- Up to 255 customize favorite scan file setting with "Single Touch" , Support Windows 7/8/10
- Turn paper documents into searchable, editable files - save scans as searchable PDF files; OCR function included
- Info Barcode function - automatic categorization of complicate documentation and data with 1D or 2D Barcode page.
- Intelligent color and image adjustments — Auto Rotate, Crop, Deskew and blank page remove with Plustek Image Processing Technology
- Easy send scanned files to FTP server or personal NAS (FTP) with PDFs , Jpeg , TIFF or Png format. User can download scanner driver from Plustek website
PyMuPDF’s page operations use coordinates relative to the unrotated page. Rotation affects Page.rect, but does not change Page.cropbox to match; see The Basics and the Page documentation. Therefore, do not assume coordinates derived from a rotated display rectangle can be passed directly to an operation on the unrotated page. Mixed-size and rotated PDFs may need page-specific handling.
Save a separate copy and check the output
- Inspect representative pages for their dimensions, rotation, and page boxes.
- Choose whether the task is cropping, adding canvas area, shifting content, or scaling it.
- Apply the operation with the library’s page-box or transformation APIs, keeping the content placement and page dimensions aligned.
- Save to a new PDF rather than overwriting the source.
- Open the saved file and inspect representative pages, including any rotated or differently sized pages. Confirm that the intended edges are visible and that added whitespace is actually present.
The cited project documentation describes these APIs and their behavior; it does not establish a performance advantage for either library. API details can change, so consult the current documentation for the version installed in your Python environment.
Quick Recap
Best Value
- PORTABLE SCANNER FOR USE ON-THE-GO — The fastest and lightest mobile single-sheet-fed compact document scanner in its class¹
- QUICK DOCUMENT SCANNING ― This Epson ultra-fast scanner scans a single page as quickly as 5.5 seconds²; Windows and Mac compatible
- VERSATILE PAPER HANDLING ― Portable scanner scans documents up to 8.5 x 72 in; Also easily digitizes receipts and ID cards to make accounting, bookkeeping, and organizing simpler
- INTUITIVE, HIGH-SPEED SOFTWARE — Epson ScanSmart Software³ is a smart tool allowing you to easily scan, review, and save; Stay organized easily with the help of this Epson scanner
- EASY SETUP — USB-powered connect to your computer for quick and simple scanning; No batteries or external power supply required to operate portable document scanner; Standard Connectivity: USB 2.0
Rank #4
- Note: No software installation is required. You need 2 AA batteries ( not included) and a memory card ( included) to use it directly. Scan mode: Press and hold "Scan" for 2 seconds to turn on the device, and then press "Scan", the green light is on. The scanner moves to scan the file until the green light turns off automatically (or press the "Scan" key and the green light goes out). The number shown on the display increases by 1 to indicate that the scan is complete.
- Portable Scanner scans images or pictures quickly: Store JPEG/PDF files within seconds, scan images or pictures quickly, plug and play, no need any software preinstalled. Compatible with Windows XP/7/Vista/Mac OS 10.4 or above version.
- Lightweight and travel-friendly: Stored in Micro SD card directly, support read data on your computer or phone with USB connected. Powered by 2pcs AA batteries, Compact Design, it is convenient to carry outside.
- 3 Image Resolution: 3 modes of resolution for your options: 300dpi/600dpi/900dpi, you can save it at the clearest way, picture and document are showed clear as it is. Freely choose your favorite resolution.File Format: JPEG/PDF format is all available, Great storage capacity as it supports 32G Micro SD card(Included 16GB Card),total meet your need for business trip or daily use.
- Widely Used: It is applicable in bank, insurance business, real estate agency,home, office, library or outdoors. suitable for lawyer, businessmen, students, travelers and amateur archivists. Scan your important files and save them immediately, no struggling in finding a printing shop, keep it confidential.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.




