It is to be noted that although the above embodiment has been described for a case of formatting the document including both text data and figure data, the present invention can also be applied to a case of formatting a document including just figure data or just image data.