A computer program product comprising a computer usable non-transitory medium having a computer readable program code embedded therein for controlling a data processing apparatus, the computer readable program code configured to cause the data processing apparatus to execute a process for generating data to be displayed on a display device connected to the server via a network, the process comprising:
- (a) constructing a hierarchical data structure from the input document, the hierarchical data structure including a plurality of content elements detected from the input document and placed in a hierarchical structure;
- (b) storing the hierarchical data structure including a plurality of content elements in a hierarchical structure;
- (c) storing a plurality of content removal and reorganization rules, each rule corresponding to a type of display device, the rules including:
- a first rule corresponding to a first type of display device which supports a first type of touch screen that is capable of detecting a position where a user touches the touch screen with a finger, a second rule corresponding to a second type of display device which supports a second type of touch screen that is capable of detecting a position where a user touches the touch screen with a stylus pen, and a third rule corresponding to a third type of display device which supports hardware keys, the first, second and third rules being different from each other;
- (d) receiving a request for content from the display device;
- (e) determining a device type of the display device;
- (f) generating display data for an output document, based on hierarchical data structure for the requested content by applying a selected one of the content removal and reorganization rules which correspond to the device type determined in step (d), including removing a subset of the content elements and rearranging remaining content elements according to the rule, wherein the rearranging includes:
- increasing a character spacing or a word spacing or both from their respective values in the input document by a first amount when the first rule is applied, increasing the character spacing or the word spacing or both from their respective values in the input document by a second amount when the second rule is applied, and maintaining the character spacing and the word spacing of the input document when the third rule is applied;
- and
- (g) transmitting the display data to the display device.