How do I rotate certain pages of a PDF to a particular direction?

I have a PDF file of 400 pages made up of scanned pages. But, the orientation of the PDF file is such that half of the pages are rotated to the right, while half of them are rotated to the left. I mean to say that if page number 1 is rotated 90 degrees towards left, page number 2 is rotated 90 degrees towards right. And this pattern continues upto the last page.

Is there a way to rotate the pages to make them upright? Any help in this regard will be appreciated.


Solution 1:

I thought that this would be a really hard work to do. But I could never be so wrong. Adobe Acrobat DC saved the day. There was a easy way to do this which I missed previously. Opening the PDF in the Acrobat DC and clicking Tools>Organize Pages led me to an option where I could select Clockwise/Anticlockwise rotation for Even/Range of/Odd pages.

Here is the link to refer and know more about the same: Rotate, move, delete, and renumber PDF pages

Solution 2:

If anyone is looking for a command-line tool to do this, check out pdftk server.

It's free from PDF Labs. They say:

PDFtk Server is our command-line tool for working with PDFs. It is commonly used for client-side scripting or server-side processing of PDFs.

and

PDFtk Server can:

  • ...
  • Rotate PDF Documents or Pages
  • ...

PDFtk Server does not require Adobe Acrobat or Reader, and it runs on Windows, Mac OS X and Linux.

The details are on the man page, but for example:

pdftk <infile> rotate 1-endevenright 1-endoddleft output <outfile>

No affiliation, just a satisfied user.