1. A computer readable medium storing a computer program which when executed by at least one processor analyzes a document, the computer program comprising sets of instructions for: receiving the document that comprises a plurality of primitive graphic elements, each primitive graphic element defined as a single object in the document, the document having a drawing order that indicates the order in which the primitive graphic elements are drawn when the document is displayed; identifying positional relationships between successive primitive graphic elements in the drawing order; and based on the positional relationships, defining a single structural graphic element from at least two of the primitive graphic elements.