views:

172

answers:

3

This may be a naive question, but bare with me. I have a program that outputs a report into plain text. The report must be plain text for it to load into a third party program. The report also needs to be printable.

When dealing with plain text, what limits should I set on line size and number of lines on a page to get it to print reasonably?

+1  A: 

its going to depend on your printing font, you want to aim for a fixed width font so that it is consistent, 80 columns is generally safe.... i think....

edit: here is a quick guide I googled - http://dsl.org/cookbook/cookbook%5F17.html

Mobs
72 is closer to printing standards (which I believe are most happy with 68 per row <-- there is an article about this somewhere on SO)
ldigas
+1  A: 

If you have control over the output format, consider a lightweight WYSIWYG markup language, Such as reStructuredText, AsciiDoc, markdown etc.

This way you can pipe the plane-text format into a converter that will result in postscript, PDF or HTML, that you can then print. This also mostly negates the need to consider the line width for the sake of your printer. The converter will do this for you.

Chen Levy
+1  A: 

It definitely depends on the font you use when printing, and unless you have control over that you can't guarantee it will print nicely. For example, in Word 2007, creating a blank document and setting the font to Courier New 10pt only fits 77 characters per line and 28 lines per page. Changing the margins and line spacing will modify that. However if you used that and they tried to print from Wordpad it wouldn't work because the default with Courier New 10pt only fits 72 characters per line. In either case, the standard 80 characters doesn't work. Those defaults aren't even global defaults.

The best you can probably do is pick a size and provide instructions on printing the report with several common editors so it will look acceptable. Specify the font, margin, line spacing, etc.

Have you considered other options, like creating two files? One could be plain text for import into the other program. The other could be a format better suited for printing.

CodeGoat
I think I am going to be specific about what programs/settings to use for printing the files. Thanks for the advice.
James McMahon