8. A method comprising: extracting a character string from a document including layout information; determining whether the extracted character string is a heading based on a heading tag, a character size and a line space between character strings; acquiring space character width information; determining a spacing amount of each inter-character space based on the extracted character string and the layout information; determining whether a space character is to be included in each inter-character space based on the determined spacing amount of each inter-character space and the acquired space character width information; and inserting a space character code into an inter-character space in which a space character is determined to be included, wherein, when the extracted character string is determined to be the heading, the acquired space character width information is corrected in the inserting step, and it is determined in the inserting step whether the space character is to be included in each inter-character space based on the spacing amount of each inter-character space and the corrected space character width information, and the space character code is inserted into the inter-character space in which the space character is determined to be included.
8. A method comprising: extracting a character string from a document including layout information; determining whether the extracted character string is a heading based on a heading tag, a character size and a line space between character strings; acquiring space character width information; determining a spacing amount of each inter-character space based on the extracted character string and the layout information; determining whether a space character is to be included in each inter-character space based on the determined spacing amount of each inter-character space and the acquired space character width information; and inserting a space character code into an inter-character space in which a space character is determined to be included, wherein, when the extracted character string is determined to be the heading, the acquired space character width information is corrected in the inserting step, and it is determined in the inserting step whether the space character is to be included in each inter-character space based on the spacing amount of each inter-character space and the corrected space character width information, and the space character code is inserted into the inter-character space in which the space character is determined to be included. 10. The method according to claim 8 , wherein the document is in Portable Document Format (PDF) or Page Description Language (PDL).