A method and apparatus for formatting a computer-generated document for
output, such as printing, is provided. Information necessary to generate
a document is extracted from a database. The extraction program assigns a
layout identifier to each data record retrieved from the database based
on the type of information contained within the data record and how the
information is to be formatted in the document. A layout program assigns
specific layout parameters to each layout identifier, which specify the
placement of an associated print data record within a document. Next, a
formatting program applies the set of layout parameters to a data stream
containing a plurality of data records to create a formatted document.
The various elements of the invention such as the data extraction
program, the database, the layout program and the formatter, may be
integrated into a single software program, co-resident on a single
computer system, or distributed across various computer systems on a
network. It is also contemplated that the one or more of the various
elements of the invention such as the formatter, the extraction program,
or the layout program could be embodied as hardware instead of software.