62

I have a pdf file shown upside down. So I use Okular to rotate it and it looks good. The problem is, The next time I open it with other software, it's still upside down. If I open it with Okular, it is not.

I am wondering what's happening underhood.

  • I do have write permission on that file.
  • I tried "save a copy to", but no effect. Actually, there is no save operation needed to be done. The file seems not even been modified after I rotate in Okular.
Garrett
  • 750
  • 3
  • 13
  • 28
Peng Zhang
  • 1,475
  • 3
  • 14
  • 20
  • there is also PDFsam which the basic version seems to be Free and Open Source. it is also cross platform! – Foad Dec 09 '18 at 12:17

8 Answers8

62

Another great and tiny program for this is PDF-Shuffler and its fork PDF Arranger.

merge or split pdf documents and rotate, crop and rearrange their pages using an interactive and intuitive graphical interface

Installation

You can install it from the software center, or through the command-line.

For Ubuntu 22.04 and later:

sudo apt install pdfarranger

For versions before Ubuntu 22.04:

sudo apt install pdfshuffler

Running

With Ubuntu 22.04 and later:

pdfarranger

With versions before Ubuntu 22.04:

pdfshuffler

Screenshot

0.6.0 on Linux Mint 17.2 Rafaela

Rotate a page

  1. Open a PDF (click the + button).
  2. Select the page you want to rotate.
  3. Click the rotate icon or (or use the menu).

Rotate several pages

If you want to rotate all pages, click on one, then press Ctrl+a to select all.

Or you can select as many as you want individually by holding down Ctrl as you select.

Pablo Bianchi
  • 14,308
  • 4
  • 74
  • 117
Nateowami
  • 1,475
  • 4
  • 18
  • 30
  • 2
    Perfect, especially for anyone trying to avoid doing this in a terminal. It can also be installed from the Ubuntu Software Center. – Garrett Apr 18 '15 at 00:09
  • The rotate functions do not work in version 0.6 (Ubuntu 15.04). – Luís de Sousa Jul 08 '15 at 09:24
  • @LuísdeSousa `do not work` is rather vague. What happens? It's working in 0.6 for me on 14.04. Have you tried another PDF, perhaps a very simple one? – Nateowami Jul 08 '15 at 10:42
  • Do not work == produce no effect at all. – Luís de Sousa Jul 08 '15 at 13:42
  • 1
    @LuísdeSousa You have to select a page to rotate. If you want to rotate them all, click on one to select it, then press Ctrl + A to select all, and finally click rotate. Does that work for you? – Nateowami Jul 08 '15 at 23:33
  • The particular document I am using has only one page. I believe there is a bug with this version. I made it using `pdftk`. – Luís de Sousa Jul 09 '15 at 07:41
  • @LuísdeSousa Regardless of the number of pages, are you selecting (clicking on) the page before clicking the rotate button? – Nateowami Jul 09 '15 at 07:47
  • Really fast ! Rotation are instantaneous, target file is the same size as original. It's an excellent software that do what it claim – Édouard Lopez Oct 19 '15 at 09:00
  • This is a great tool. pdftk does not seem to work for rotation anymore. – dearN Jan 20 '18 at 13:55
  • Works on Ubuntu 18.04 (you need to select the page before pressing the rotate button, even if the PDF has only one page). – Kris Nov 06 '18 at 11:10
37

To clarify, this is what you use to rotate 180 degrees:

   pdftk input.pdf cat 1-endsouth output output.pdf
#        \_______/     \___/\___/        \________/
#        input file    range  |          output file
#                           direction

Where direction can be any of these:

  • north
  • south
  • east
  • west
  • left
  • right
  • down
Boris Dalstein
  • 860
  • 6
  • 10
fedorqui
  • 9,909
  • 1
  • 23
  • 41
36

According to the man page for pdftk, one of the operations is rotate and you can save the rotated file:

The page rotation setting can cause pdftk to rotate pages and
documents. Each option sets the page rotation as follows (in
degrees): north: 0, east: 90, south: 180, west: 270, left:
-90, right: +90, down: +180. left, right, and down make
relative adjustments to a page's rotation.

Example (will rotate pages 1 to 5 +180 degrees, i.e. vertically / upside down):

pdftk original.pdf rotate 1-5south output new-rotated.pdf

However, pdftk is quite powerful and it's better that you read the man pages and use pdftk --help to meet your exact needs.

If you want to take a look at man pdftk without installing it, here's a link for 13.10: http://manpages.ubuntu.com/manpages/saucy/en/man1/pdftk.1.html

dusoft
  • 103
  • 4
  • 4
    Thanks. "pdftk A.pdf cat 1S output B.pdf". Now, the new pdf file is rotated, no matter opened by any tool. – Peng Zhang Jan 24 '14 at 03:31
  • Thanks for pointing out that even `cat` can rotate! –  Jan 24 '14 at 03:35
  • `cat 1S` didn't work for me. This did: `pdftk A.pdf cat 1-endeast output B.pdf`. Rotates 90 degrees to the right. – nh2 Jan 07 '20 at 15:47
6

Okular and other PDF viewers like Evince (part of GNOME) or Atril (part of the MATE desktop) rotate only the view of the PDF and when saving, the changes are kept in the Application settings but the PDF itself is not rotated.

There are other Desktop applications like pdf-shuffler and pdfmod and command line tools like pdftk that allow you to do what you want.

devOp_in_hiding
  • 101
  • 1
  • 1
  • This information already present in other answers – Anwar Sep 06 '16 at 10:58
  • 1
    @Anwar Actually no, this answer contains the crucial information about _why_ Okular does not offer the option to save the rotated PDF, and what it is really doing under the hood, which is not present in any of the other answers. – David Z Dec 23 '16 at 10:16
5

If you are living in the year 2021:

PDFshuffler recently did not get so much love anymore and there is a more active fork of it, which is called PDFarranger. You can install it with:

sudo apt install pdfarranger

It is also available through the Ubuntu-software. Have fun :)

tkazik
  • 225
  • 2
  • 4
3

For Okular or any other PDF viewer tool which lets you rotate one page but it's not saving it in the source pdf, you can use the Print... option and choose to Save as PDF.

Aritz
  • 153
  • 6
1

There's also PDF Mod. Looks to be very similar to pdfshuffler, but I've never used pdfshuffler. I've been using PDF Mod for years.

colan
  • 1,155
  • 1
  • 12
  • 18
0

I rotated PDF with success, using "PDF Arranger" which is GUI based tool, pre-loaded in my MX Linux (based on Debian GNU/Linux 10). Cannot be easier. Rotate it, then save it; done.

MTW
  • 1