Skip to content

Instantly share code, notes, and snippets.

@hadisfr
Last active October 6, 2020 22:50
Show Gist options
  • Save hadisfr/461c4394b53da6549eebce456de477e1 to your computer and use it in GitHub Desktop.
Save hadisfr/461c4394b53da6549eebce456de477e1 to your computer and use it in GitHub Desktop.
rotate vertical pages to horizontal in final pdf of a book
PAGES=(104-105 111-115 120)
pdftk src.pdf rotate `for PAGE in ${PAGES[@]}; do echo ${PAGE}oddleft ${PAGE}evenright; done` output dst.pdf
PageMediaNumber: [0-9]+
PageMediaRotation: 0
PageMediaRect: 0 0 481\.92 694\.56
PageMediaDimensions: 481\.92 694\.56
PageMediaBegin
\
->
PageMediaNumber: ([0-9]+)
PageMediaRotation: 0
PageMediaRect: 0 0 694\.56 481\.92
PageMediaDimensions: 694\.56 481\.92
PageMediaBegin
\
-> \1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment