thanks for links.
Here a source that generate the page order for 4:1 imposition. Hope can be useful:
/* imposition V0.01.00 2011/10/19 pages sequence for 4:1 booklet print */
/* Copyright © 2011 Valerio Messina */
/* imposition.c is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
imposition.c is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with imposition.c. If not, see <http://www.gnu.org/licenses/>. */
#include "stdio.h"
#include "stdlib.h"
int main (int argc, char* argv[]) {
int ask, tot;
int sheet, faces, face;
int left, right;
if (argc) argc--;
printf ("Imposition: generate the folded pages sequence for 4:1 booklet printing\n");
if (argc==0) {
printf ("ERROR: Supply the total pages (divisible by 4)\n");
return -1;
}
ask = atoi (argv[1]);
tot = ask;
if (ask%4 != 0) {
printf ("WARN: ask:%d should be divisible by 4\n", ask);
tot = (ask/4+1)*4;
printf ("Rounded up to tot:%d\n", tot);
}
if (tot>99999) {
printf ("ERROR: Too many tot:%d pages\n", tot);
return -1;
}
faces = tot/2;
sheet = faces/2;
printf ("\nTotal folded faces:%d\n", tot);
printf ("Total faces:%d Total sheets:%d\n", faces, sheet);
printf ("Sheet Side_ Face_ : Left_ Right\n");
printf ("-------------------------------\n");
for (face=0; face<faces; face++) {
sheet = face/2;
if (face%2 == 0) {
left = tot - face;
if (left>ask) left = 0;
right = face + 1;
if (right>ask) right = 0;
printf ("%05d front %05d : %05d %05d\n", sheet+1, face+1, left, right);
} else {
left = face + 1;
if (left>ask) left = 0;
right = tot - face;
if (right>ask) right = 0;
printf ("%05d back %05d : %05d %05d\n", sheet+1, face+1, left, right);
}
}
return 0;
}