Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Command line: How do you rotate a PDF file 90 degrees?

When I scan documents that are landscape-oriented, the output PDF files are portrait and so all the PDF viewers display the scanned documents in portrait.

From the command line, how do you rotate a PDF file 90 degrees?

I tried searching and found a bunch of solutions but I had trouble finding what looked like an authoritative solution[1] that uses a stable and robust Linux/Unix tool.

footnote [1]

For example, here is a sampling of some of the haphazard solutions I found:

"just use Adobe Acrobat Pro to rotate the file and then save the file"
"use pdfjam"
"use PDFtk"
"use ${PROGRAM_NAME} from Poppler"
"use ImageMagick's convert" -- but then all the comments were very negative and stating "the image quality is ruined"
"open the file in a PDF viewer, then rotate, then print using a PDF printer like cutePDF or PDF printer or etc"
"use ${PROGRAM_NAME}", then I searched for "${PROGRAM_NAME}" and there is something about "Fedora removed ${PROGRAM_NAME} because of licensing issues"
by

1 Answer

Amit8z4mc
Just use PDFtk.
For rotating clockwise:
pdftk input.pdf cat 1-endeast output output.pdf


For rotating anti-clockwise:
pdftk input.pdf cat 1-endwest output output.pdf

Login / Signup to Answer the Question.