Ubuntu – Evince document viewer – rotating documents


I just installed Ubuntu for the first time and I'm getting used to using it. I'm playing around with PDF documents. I have problems with rotation of pages using default document browser Evince document viewer.

I got two files:
First 'original.pdf' file with wrongly rotated pages.
Second. 'modified.pdf' file with pages rotation corrected by me.

I deleted orginal.pdf and renamed modified.pdf -> original.pdf.

Before I renamed modified.pdf ,page rotation was good. When I renamed it to original.pdf pages are being rotated wrongly. All this thing for the same file I'm only renaming it. I can cancel 'wrong rotation' by renaming 'original.pdf' to any other name. Quite strange… Of course if I open the original.pdf file with another browser pages are rotated properly.

My guess is that Evince document viewer remember rotation setting from time when I was playing with original.pdf file and is applying this rotation rules to any file named orignal.pdf even if I delete the file and rename another file to original.pdf. Sth like rule rotate pages in orignal.pdf always by 90 degree clockwise`.

Is my guess about this rotation is good? Is there a way to delete this history of rotation or deactivate it completely? I would like to see always files as they are, keep it real.

Thank you in advance for help!

Best Answer

Congrats on starting your adventure with Ubuntu. You'll be hooked in no time! My answer uses shell commands, which on a *nix OS is a good thing to become familiar with. You can access the shell by pressing the key combination CtrlAltT. The shell/terminal will pop up; then you can cd to the file location, e.g. if it's in your Documents directory, type cd ~/Documents. You can type ls to make sure your pdf is there.

You are correct, this is very typical of a document viewer to make the rotation a display property. In order to truly rotate the pdf, try using

pdftk temp.pdf cat 1-endR output tempR.pdf

which means, given a file temp.pdf, rotate 90° pages 1 to the end of the document and write out to the file tempR.pdf.

For details, see man pdftk and search for rotation, e.g.:

 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.