Including Print Features in Your Software


If you’re shipping software rather than reports, chances are your software will include at least some form of Print feature. In this section I share with you some tips on making the best Print feature possible.

Choosing the Best Menus

I get frustrated if I can’t find the Print Preview and Page Setup features of a program. Some people have separate menu items for these; some people have them embedded all inside the Print menu. Other people put them other places, and those are the programs that frustrate me.

A lot of usage experts have strong opinions about whether you should have a single Print menu or more than one Print menu. I personally am fine with either approach, since I see both so often. Therefore, I recommend that you choose one approach or the other, and stick to it, and don’t veer off and use some strange approach. Therefore, if you have separate menus, please use these three menus, all grouped together, and all under the File menu (or whatever you call your first menu):

  • Page Setup

  • Print Preview

  • Print

The first menu item, Page Setup, should have an ellipsis after its title as I show here (which means a dialog opens). The item opens the Page Setup dialog. Every Page Setup dialog will be different depending on the software package, and so I can’t give you specifics on what to include. But I can give you these general tips:

  • Allow the user to set the margins.

  • If your program is a graphics program, allow the user to choose the size of the graphic and whether it’s centered on the page.

  • Don’t allow your user to choose which pages to print in this dialog; save that for the main Print dialog!

  • Let the user choose Landscape or Portrait orientation, and use the setting accordingly.

The final item needs some clarification. In most operating systems, the print drivers can specify Landscape or Portrait. The problem is that the application software might not know about this choice and might try to print in the wrong mode, causing the pages to end up printed sideways, possibly taking up more pages than expected. The solution, then, is for the application software to be aware of whether Landscape has been chosen or not and to write the text and graphics appropriately for the choice.

RULE

Your application shouldn’t just always print for Landscape and let the print driver choose which way to orient the printout.

The next menu item, Print Preview, opens up the Print Preview portion of your application. I talk about this in “Including a Print Preview,” later in this chapter.

The final menu item, Print, opens up the Print dialog box. Most operating systems have a built-in Print dialog box, and you’re welcome to use this. However, these dialog boxes don’t give your users much control, and for that reason I encourage you to consider creating your own Print dialog box, but only if the built-in dialog box doesn’t give you everything you need. Your Print dialog box should include these options (all of which belong here and not in the Print Preview dialog box):

  • Which part of the document to print, such as which pages

  • How many copies to print

  • Which printer to print to

In addition, you should allow the users to open up the driver-supplied Print Options dialog boxes. What I recommend you do is look at the built-in Print dialog box and model your own Print dialog box after the built-in one, adding additional necessary features, such as which part of the document to print. However, remember to do this only if the standard Print dialog box doesn’t offer you what you need; no reason to reinvent the wheel!

As an alternative, some people prefer to have only one menu and make the Print Preview and Page Setup features available from the main Print dialog box. That’s fine, but these should perform the same options as I just described, except they’re accessible from the dialog box rather than from the menu bar. Be careful, however, with the problem of cascading dialog boxes. You don’t want the screen to look messy. Some people handle this by closing the dialog boxes in back and then reopening them when the front dialog closes. For me, that’s also a bit messy, and that’s why I personally prefer three separate menu items.

Including a Print Preview

A Print Preview feature is easier to implement than you might expect. Most operating systems these days (Windows is one example) let you create a canvas at print time, draw on the canvas, and then send the canvas to the printer as the page. A Print Preview is easy, then: Use the same drawing methods, but after you’ve finished, copy the canvas to the screen. Quick and easy. You have two things you need to worry about, however:

  • You might have multiple pages to print; therefore, in the Print Preview feature, let the user select a page to view without having to exit out of the Print Preview and restart it.

  • Printers have drastically different resolutions than a screen.

If a printer has 2400dpi resolution, and the drawing area on a sheet of paper is 8 inches by 10.5 inches, then the page has 19200 dots across by 25200 dots down. That’s a lot more than the 1024 across by 768 down on a typical computer screen. The solution, then, is to scale the printout. But in writing the code to do so, you’re actually opening up an extra feature that the users will appreciate, the ability to zoom the document in Print Preview mode.

Scaling is actually easier than you might expect. Most operating systems let you perform all your drawing routines based on inches rather than pixels. To scale, you simply adjust the dots per inch and redraw, done deal. In Windows, this is accomplished through what is called a Window Port and a View Port. You can read up on these in the API manuals.

RULE

Before writing all kinds of high-powered scaling routines, investigate which routines are available to you that provide scaling.

Remember, however, that fonts are sized not in pixels but in inches. A 12-point font takes up 12/72 of an inch. When you draw a 12-point font on the screen, the operating system attempts to draw the font so it takes up 12/72 of an inch, or .16666 inch. When you print to the paper, then, your font will also show up as 12/72 of an inch. If you don’t use the operating system’s scaling mechanism and instead use your own calculations, you might be surprised to find that your fonts didn’t scale. Be sure to read in the API manuals how the operating system handles font sizes as well.

Wasted Paper in Your Printer

I’d like to wrap up this chapter with a little pet peeve of mine about software in general. Too often, software doesn’t let me choose what to print! If you, the programmer, created a software package that deals with text (such as a word processor), and I, as the user, select only a few characters, then let me choose to print only those characters I selected.

Microsoft Word 2000 and higher lets me do this, and that’s a good thing. In the Print dialog box, there is an option to print the selection. That way, if I want to print only a single sentence in a 300-page book, I can do so. Internet Explorer lets me do this too, and it’s in the “page range” option.

RULE

Don’t make your users print the entire document every time.




Designing Highly Useable Software
Designing Highly Useable Software
ISBN: 0782143016
EAN: 2147483647
Year: 2003
Pages: 114

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net