Change PDF orientation in linux command line

Problem

You would like to change the orientation of a PDF file (portrait to landscape) in the linux command line

Solution

Use the pdftk program as following (taken from the answer https://unix.stackexchange.com/a/394068)

pdftk portrait.pdfcat 1-endwest output landscape_anti_clockwise.pdf

pdftk portrait.pdf cat 1-endeast output landscape_clockwise.pdf