1. A document processing apparatus comprising: an extraction unit configured to extract a leading edge of a first object at an end of a first page, and a leading edge of a second object at an end on the side facing the first page end, on a second page following the first page; an overlapping determination unit configured to determine whether a result of overlapping the leading edge of the first object with the leading edge of the second object satisfies a certain condition; a merging unit configured to generate a merged object by using both the first object comprising the leading edge and the second object comprising the leading edge in a case where the overlapping determination unit determined that the result of overlapping satisfies the certain condition; a reduction unit configured to reduce the merged object so that the merged object fits into one page; and a calculation unit configured to overlap the leading edge of the first object with the leading edge of the second object to calculate the area matching rate based on the overlapping area, wherein the calculation unit vertically and horizontally overlaps the leading edge of the first object with the leading edge of the second object to calculate the area matching rate based on a maximum overlapping area.