View Single Post
Old 01-25-2021, 10:39 PM   #1839
willus
Fuzzball, the purple cat
willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.willus ought to be getting tired of karma fortunes by now.
 
willus's Avatar
 
Posts: 1,303
Karma: 11087488
Join Date: Jun 2011
Location: California
Device: iPad
You cannot quite do this operation with only k2pdfopt since it cannot rotate specific pages. You'll also need a utility like qpdf which can merge two pdfs together. If you have qpdf, here would be the commands to run:
Code:
k2pdfopt -grid 1x2x0 -mode crop booklet.pdf -o split.pdf
k2pdfopt -p 2-e split.pdf -mode copy -n -o booklet1.pdf
k2pdfopt -p 999-1o split.pdf -mode copy -n -rt 180 -o booklet2.pdf
qpdf --pages booklet1.pdf booklet2.pdf -- --empty booklet_final.pdf
The first command splits each page into two. The second command copies only the even pages to a new file. The third command copies only the odd pages into a different new file in reverse order and rotates them. The final (qpdf) command joins the results from the previous two commands.

Last edited by willus; 01-25-2021 at 10:41 PM.
willus is offline   Reply With Quote