Rotate each page of a PDF from the command line

A common issue with document scanning is that pages may have been inserted in the wrong orientation, making the PDF difficult to read with upside-down text. This is trivially fixed with the QPDF command line tool.

qpdf --rotate=180 in.pdf out.pdf
in.pdf
input PDF file needing rotation out.pdf
output PDF file with rotated pages
--rotate=180
rotate each page 180 degrees

QPDF can do vastly more operations on PDF files as seen in the QPDF documentation. Poppler is oriented toward rendering and extracting content from PDF files rather than modifying them like QPDF, which does not render PDF files.

Install QPDF

  • Linux: apt install qpdf or similar
  • macOS: brew install qpdf
  • Windows: winget install QPDF.QPDF

On Windows, QPDF is installed under $Env:ProgramFiles/qpdf*/bin/qpdf.exe