progprint
Progprint is a free open-source Linux program for printing C / C++ source programs. It tries to avoid splitting logical sections across page boundaries. This is helpful for the process of understanding a program, reviewing a program for logic or coding errors, or for making notations in preparation for major revisions.
Progprint figures out the best way to segment a file for printing, fitting as many logical sections as possible on each page, while trying to avoid splitting logical sections accross page boundaries.
A logical section (in a C / C++ program) is defined by a pair of braces {...}, which may be nested to any level. In deciding where to place page breaks, progprint uses the following rules:
top priority is given to outermost braces (boundaries of functions)
nested braces (code blocks) are prioritized less as the nesting level increases
lines immediately preceeding an opening brace are grouped with the following code block
pure comment lines (having no code) are grouped with the following code
blank lines are used for additional breaks where needed to fit within pages
For Linux systems using the CUPS printing system (the great majority), you may adjust the font size and page layout. This can be used to increase the print density up to about 140 characters per line and 120 lines per page for letter or A4 paper in portrait orientation.
To download and install progprint, visit the download page.
