[C] Multiple pages per sheet numerator

This program was created due to the fact that there is no sane way to use "Multiple pages per sheet" duplex printing in applications that allow such errand.

Practically, I came across a situation where I wanted to print two pages per sheet but in duplex. Since there is no option to do that automatically, I had to input pages to print manually. Basically, for front side, you have to input two pages, than skip two, {do while}, and with the same pattern, write down the complement of previously chosen set of pages

This little piece of code does that for you. It asks for lower page limit (you might want to start printing from page 67, for example) and for upper page limit, after what it will print front page combination and back page combination.

Bugs: an extra coma in the end of the output.

Source

double_print.c

Program successfully compiles under:

  • [x86]gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
  • [x86]Visual Studio 2008 Professional [Windows Vista x64]
  • [IA64]gcc version 4.1.2 ia64-hp-hpux11.23