1. A document image generating apparatus, comprising: an accepting unit that accepts an image data representing a document image; a word extracting unit that extracts a word included in the document image represented by the image data accepted by the accepting unit; a character extracting unit that extracts characters included in the word extracted by the word extracting unit; a special character storing unit that stores a special character among characters to be extracted by the character extracting unit; a determining unit that determines whether the special character stored in the special character storing unit is included in characters extracted by the character extracting unit or not; a preparing unit that prepares a ruby for the word extracted by the word extracting unit; a generating unit that generates a ruby-added image data representing a ruby-added image in which the ruby prepared by the preparing unit is added to the document image represented by the image data accepted by the accepting unit; and an adjusting unit that adjusts a position of the ruby prepared by the preparing unit in the ruby-added image represented by the ruby-added image data generated by the generating unit, wherein the adjustment amount of ruby adjusted by the adjusting unit when the determining unit determines that the special character stored in the special character storing unit is included in characters extracted by the character extracting unit (case A) is different from the adjustment amount of ruby adjusted by the adjusting unit when the determining unit determines that the special character stored in the special character storing unit is not included in characters extracted by the character extracting unit (case B), such that the position of ruby would be the same in case A as in case B, wherein a position of the ruby in the ruby-added image data generated by the generating unit is determined in accordance with an average height value of characters extracted by the character extracting unit except for the special character.