Patent ID: 7934154

Claim:
A document processing apparatus having a CPU and a memory unit capable of performing layout processing using content data and a template of one page, comprising: a first arranging unit which arranges a flow area in the template; a second arranging unit which arranges a container outside the flow area; a generating unit which generates at least one subtemplate for the flow area; a setting unit which sets an extraction condition to extract first content data from a database for the flow area, where the subtemplate includes an area for inserting the first content data; an acquisition unit which acquires from the database at least one record, composed of a plurality of content data including the first content data, based on the extraction condition set by said setting unit, and which acquires second content data for the container; a first layout unit which lays out the second content data in the container by performing layout processing once based on the container and the second content data; a second layout unit which, when the first content data is contained in a plurality of records, lays out the plurality of records in a plurality of subtemplates, respectively, by performing layout processing a number of times corresponding to a number of records which contain the first content data; and an output unit which outputs a layout result in which plurality of records and the second content data are laid out in the template of one page.