Patent ID: 8090202

Claim:
A document processing apparatus comprising: a region extracting unit that extracts a plurality of regions in a document image; a recognition unit that recognizes a character string in each extracted region; a conversion unit that converts the recognized character string in each extracted region; a setting unit that sets first boundary lines that surrounds the document image and a second boundary line in a space between adjacent regions of the plurality of regions, wherein each second boundary line is a linear line extending to a position blocked by another region, the first boundary lines and the second boundary lines define cells for the respective regions, and each cell surrounds the corresponding region; an enlargement/reduction unit that moves in parallel a line of the first and second boundary lines under a restraint condition that the line does not intersect any of the plurality of regions, and enlarges or reduces a region in accordance with the parallel movement of the line so long as the region does not get out of the corresponding cell; and an insertion unit that inserts the converted character string into each of the regions at least one of which is enlarged or reduced by the enlargement/reduction unit.