Patent ID: 7757167

Claim:
A document processing apparatus for deciding a layout by using data to be output and a template containing regions to which the data is assigned, the document processing apparatus having a CPU and a memory unit, comprising: a selecting unit constructed to select a first region, and subsequently to select a second region after the selection of the first region; a first setting unit constructed to set a link between the first region and the second region to connect the first region and the second region; a second setting unit constructed to set a first value indicating a higher priority order than a second value for the first region selected first by said selection unit and to set the second value indicating a lower priority order than the first value for the second region selected after the selection of the first region by said selection unit according to the order of selection of regions selected by said selection unit; and a user interface unit constructed to display a user interface indicating that the first region can invade the second region and the second region can not invade the first region when the first value is set for the first region and the second value is set for the second region; a layout unit constructed to decide a size of the first region to which the first value is set by using a size of the data assigned to the first region and to decide a size of the second region for which the second value is set such that the second region does not invade the first region of which the size was decided when the second setting unit sets the first and second values for the first region and the second region connected by the link, and to decide the size of the first region and the second region connected by the link such that respective change amounts of the data assigned to the first region and the second region are the same when the second setting unit does not set both the first and second values for the first region and the second region.