1. A computer-readable medium storing a ruled line extracting program that causes a computer to execute a process to extract a ruled line in a document image of a document, the process comprising: extracting a ruled line candidate from the document image by executing a labeling process on the document image and selecting the ruled line candidate which is a black pixel link component satisfying a first requirement predefined to be met by figures of elements of the ruled lines; judging if the ruled line candidate is stable or unstable according to a structural stability of the ruled line candidate extracted in the extracting; determining a second requirement to be met by the figures of the elements of the ruled line different from the first requirement according to the ruled line candidate judged as stable in the judging and the first requirement; and re-extracting a ruled line candidate according to the second requirement determined in the determining.