A layout process using content data as output and a template containing
regions to which content data is assigned is provided. A document
processing apparatus performing the process includes a priority order
setting unit that independently sets, for regions to lay out contents
data, priority orders by assigning contents data in the regions and a
determining unit for determining the size of a region for which a first
priority is set. The determining unit uses a template containing the
regions and sizes of contents data to be assigned to regions, and
determines a size and a position of remaining regions using a portion of
the template to which the regions having higher priorities than the
remaining regions not laid out and sizes of the contents data to be
assigned to the remaining regions.