1. A ruled line extracting program that causes a computer to extract a ruled line in an image of a document, comprising: an extraction step that extracts a ruled line candidate from the image of a document according to a first requirement predefined to be met by figures of elements of the ruled lines; a judgment step that judges if the ruled line candidate is stable or unstable according to a structural stability of the ruled line candidate extracted in the extraction step; a requirement determination step that determines 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 judgment step and the first requirement; and a re-extraction step that re-extracts a ruled line candidate according to the second requirement determined in the requirement determination step.