xtmci

pdfCropMargins: The command line tool for cropping the margins of PDF files

Mon May 18 4:29 pm EDT 2026
xtmci@atomicmail.io

Table of Contents

The installation and basic usage

  • In Linux, use the pip utility.
  • In Windows, use the py.exe program with -m switch.
  • The actual name of the script is pdf-crop-margins.

In Linux, the easiest and common way of installing pdfCropMargins is to use pip:

pip install pdfCropMargins

In Windows, open the Start menu, search for Command Prompt and open it. Enter the following command to install pdfCropMargins:

py.exe -m pip install pdfCropMargins

Now, you can use the pdf-crop-margins command for cropping the margins of your PDF files. For example:

pdf-crop-margins -v -p 5 input.pdf -o output.pdf

I've used three options in this example:

  • -v Prints verbose information during the cropping process.
  • -p Specifies the percentage of margins to preserve.
  • -o Specifies the name of output file.

For more information about using pdfCropMargins, visit the pdfCropMargins homepage.