title: automatically imposing 4 pdf pages into A4 sheet following custom order
body: <p>I want to reassemble my PDF documents to print them on A5 using the A4 format from my printer.
  Also I need to print two sites (slides) on each A5 page which of course should be double sided. Hence the A4 page is in landscape format. Than I want to cut it in the middle.
  A short example for 9 slides:</p>
  
  <pre><code>first A4   first back    second A4
   [1][5]      [3][7]       [9][-]
   [2][6]      [4][8]       [-][-]
  </code></pre>
  
  <p>After cutting it it would get me slides 1-4, 5-8, 9 on a two-sided A5 paper.</p>
  
  <p>Printing this using "Booklet Printing" has not worked yet.
  I thought of reassembling the PDF pages automatically with a shell script using pdftk and calculates mod 8 as changing the order manually is not an option. After I rearanged the order I can easily print the slides using the options of my printer.</p>
  
  <p>How could that be done or is there an easier way to it?
  Thanks</p>