I was wondering in a pdf file, how to rotate pdf pages: 90 degree for even pages and -90 degree for odd pages?By pdftk, all I know is to rotate a page by pdftk in.pdf cat 1W output out.pdf, and rotate all pages by pdftk in.pdf cat 1-endW output out.pdf.Thanks!
Rotate pdf pages: 90 degree for even pages and -90 degree for odd pages
pdf;pdftk
This is easy since pdftk 1.44 which added the shuffle operation allowing different transformations on odd and even pages (amongst other uses).If you have an older version of pdftk, you can use this Python script with the PyPdf library. (Warning, typed directly into the browser.)#!/usr/bin/env pythonimport sysfrom pyPdf import PdfFileWriter, PdfFileReaderinput = PdfFileReader(sys.stdin)output = PdfFileWriter()for i in range(0,input.getNumPages()):    output.addPage(input.getPage(i).rotateClockwise(90 if i%2==0 else -90))output.write(sys.stdout)