Patent ID: 8793572

Claim:
A method for rendering a page, comprising: obtaining, before outputting the page, an electronic document comprising a text stream and an anchor corresponding to a graphical object and specifying a first displacement of the graphical object relative to the anchor; placing, during a first layout of a page and before outputting the page, the text stream and the anchor within a region of the page; identifying, during the first layout and before outputting the page, a first location on the page corresponding to the anchor; calculating, before outputting the page and based on the first location and the first displacement, an area on the page for placing the graphical object; marking, during the first layout and in response to the region overlapping the area, the graphical object as pinned before outputting the page; initiating, in response to the region overlapping the area and before outputting the page, a second layout of the page; placing, during the second layout and before outputting the page, the text stream and the anchor on the page by wrapping a portion of the text stream around the area; identifying, during the second layout and before outputting the page, a second location on the page corresponding to the anchor, wherein the second position and the area are separated by a second displacement distinct from the first displacement; and outputting, in response to identifying the second location and in response to marking the graphical object as pinned, the page for at least one selected from a group consisting of display and printing, the page comprising at least the portion of the text stream and with the graphical object occupying the area.