CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2005

    Sorting post card

    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.


  2. #2
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008

    Re: Sorting post card

    Since we have no idea how you have this coded it is hard to say much

    Looks like you could track the page number in a variable

    Then as you go across/down the page start with the page number for the first one add 4 for the next one add 4 for the next one and so on until the end of the page then repeat for each page

    1 1+4=5 5+4=9
    9+4=13 ....

    2 2+4=6 6+4=10

    3 3+4=7 ....

    Will that work for you?

    If not then maybe you should show us some code
    Always use [code][/code] tags when posting code.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.