A device for printing a document, such as an HTML document, in which data
to be incorporated into an output image can be described in the form of
reference to an outside source, the device being capable of smooth
printing a large document using a small memory. A document structural
information manager creates document structural information which
describes a structure of document elements, based on a result of analysis
on an HTML document carried out by a document analyzer. During
asynchronous downloading of substantial data of each document element,
should work memory shortage occur, a memory manager unloads substantial
data of a document element with a latter order at which to be
incorporated into an output among those in the work memory, and saves the
unloaded substantial data in an HDD. Thereafter, when data becomes no
longer necessary as a result of being printed, the memory manager deletes
the data from the work memory and reloads data saved in the HDD back to
the work memory.