A method and system in a document viewing control for laying out an
invisible page grid based on various criteria, including whether the
pages of a document are fixed, contain reflowable content, whether the
fixed pages are all the same size, and where the user has actively
focused a page when a new layout needs to be generated, which may be
anytime a user changes the number of pages to display. Upon such a
change, a mechanism determines page sizes based on whether the focused
page has flow or fixed content. A layout mechanism computes the grid
based on the number of pages (columns) to display across. For documents
with mixed-sized and/or mixed flow and fixed pages, rows of the grid are
determined from the active page to the start of the document, and from
the active page's row to the end of the document. The grid provides
consistent viewing results.