11. A computer-readable medium having computer-executable instructions for applying document content to adaptive templates, the computer-executable instructions comprising: calculating a template score for a template based on how well the document content fits the template to determine whether to include the template in an appropriate set of templates; determining the size and position of an element within a template of the set of templates; calculating two-dimensional regions of a layout page; reducing the size of the two-dimensional regions according to element overlap and z-ordering; inserting document content into the two-dimensional regions; and paginating the document content by using the template score along with a previous template score for a previous page of content and a subsequent template score for a subsequent page of content to calculate an optimal sequence of the appropriate set of templates.
13. The computer-readable medium of claim 11 , wherein selecting the appropriate set of templates further comprises: analyzing content preconditions of each template against the document content; and evaluating value preconditions of each template against a plurality calculated constraint values respectively associated with each template.