I am creating an application using a PDF as template to create post cards. The page has 9 post cards across sorted (see below).

1 2 3

4 5 6

7 8 9

Now, when everything is printed and we cut the page, the sorting gets messed up. That is, the first tray contains 1, 10, 19 etc..I am trying to code (sort) in such a way that the first page contains (for eg: lets consider total of 35 post cards)

1 5 9

13 17 21

25 29 33

and second page contains

2 6 10

14 18 22

26 30 34

and so on so that when the pages are cut, each stack is sorted. Hope I made myself clear.

Any help is appreciated.

Thanks