Rearrange contents to fit into pages.