Reprint from Progressions


PROFORM

Printer Interface

In the past our efforts at print formatting has been limited to forcing the printer into compressed print. When really pressed, we have actually gotten a laser printer into landscape mode. Anything more agressive involves a confusing morass of hardware specific printer codes. Then we hope the client doesn't get a new printer.

Getting special forms done at a print shop is a hassle too. We still have to write programs for field positioning. And every time we need to use them the forms have to be placed in the printer.

This is depressing since WordPerfect seems to know everything about every printer in the world. And it provides a graphic preview on the screen, so we can see what something will print like before we print it. There ought to be a way to integrate this knowledge with a Progress Application.

We could make our Progress applications write a mail/merge file. That adds a clutzy extra step. Especially if we just want to spit out an envelope with a client's name on it. And we can't assume that all users of our software will have the same word processor. But could we do the reverse? In essence a merge utility for laser printer data streams? We figured out that we could, and did.

We called it Proform. It provides a simple way for Progress applications to insert data into Laser printer data streams for HP LaserJet style or Postscript printers. This lets us design a complex form using Word Perfect or Ventura Publisher or any other compatible DOS or Unix package. Execution is under control of the Progress application. The data is merged by field name, saving the application from concern for pixel positions and fonts.

The steps needed to develop a form are:

1. Draw the form with the WP or DTP software.

2. Pick field names and place them in the form. (eg: [toname] )

3. Use whatever WP option is appropriate to Print to Disk. That file is our final-form output for use by Proform.

4. Write the Progress code. The example above is simplified, but you get the idea. Fields can be written in any order.

5. Run the application. Each time Proform reads the !PAGE! line it produces a complete output form with the substitutions you have given it.

For instance, one of the applications Pat (my partner) wrote is for our billing system. Each month it creates an envelope for each client for whom we have a bill record. We already had a WP file for an envelope, complete with our company logo and address. All Pat had to do was take that file, put in the field identifiers, ([addr1],[addr2], etc) print and save it, and write a little code. It took 20 minutes from start to finish, including showing her how. Now we put in a stack of plain white envelopes and run one application each month.

Proform also separates the skills required. For example, in our consulting firm, Pat is the expert on Progress coding, and I am only mediocre. My expertise is Unix and desktop publishing. Pat's ability with DTP is limited to writing memos. I can build the forms for Proform, then let Pat handle the application code. If the appearance of the form needs to change or the target printer changes, I can amend it without needing to alter the Progress code.