Patent ID: 8332743

Claim:
A layout decision method executed in a layout decision apparatus that generates a document based on a template, the template including a plurality of field areas, contents data being input into a field area of the plurality of field areas from a record, the method comprising the steps of: setting a link which associates the plurality of field areas in the template with each other; deciding a position and size of the field area by calculating based on a size of the contents data to be input into the field area; determining whether or not a mask is set to the decided field area; creating a mask for covering the decided field area in the case where it is determined that the mask is set to the decided field area; and covering the decided field area with the created mask, wherein the size of the field area is decided to be optimized such that each size difference between a size of the contents data to be input into the field area and a calculated size of the field area is equal to each other among the plurality of field areas, wherein the size of the field area is decided based on calculating an optimized size difference between an ideal size of the field area and the calculated size of the field area, and wherein the optimized size difference corresponds to a minimum sum of squares of each size difference and wherein the ideal size is a size of the field area in the case where the contents data is input into the field area without any constraint regarding a position and size of the field area.