10. A system for optimizing a layout of a document, the system comprising: one or more processors which determine, from a template document having a plurality of individually-specified components including at least one user-content component configured to receive user content from a user of the template document and each individually-specified component having a corresponding predefined original position and original size, a plurality of spacing distances representing ideal spacing distances between the at least one user-content component and corresponding one or more others of the individually-specified components; one or more processors configured to receive and insert at least some user content into at least one user-content component of a user document constructed based on the template document; one or more processors configured to determine current spacing distances between the at least one user-content component and the corresponding one or more others of the individually-specified components in the user document; one or more processors configured to generate an energy model of the layout of the user document based on the ideal spacing distances from the template document and the current spacing distances in the user document, wherein the energy model models the spacing distances between the at least one user-content component and the corresponding one or more others of the individually-specified components as deformable springs in a closed system, the energy model having a calculated deformation energy for each deformable spring representing an amount the distance between the respective at least one user-content component and a corresponding other of the individually-specified components diverges from the corresponding ideal spacing distance determined from the template document, the energy model further having at least one constraint represented by a calculated at least one of user-content component overlap energy representing how much the at least one user-content component overlaps another user-content component, a background overlap energy representing how much the at least one user-content component overlaps a background component, and a color proximity energy representing how close in color the at least one user-content component is to the color of a background image on which it lies; and one or more processors configured to adjust one or more positions of the at least one user-content components in the user document to minimize the energy of the layout in the user document based on the calculated deformation energy for each deformable spring and the calculated at least one of the user-content component overlap energy, the background overlap energy, and the color proximity energy.
10. A system for optimizing a layout of a document, the system comprising: one or more processors which determine, from a template document having a plurality of individually-specified components including at least one user-content component configured to receive user content from a user of the template document and each individually-specified component having a corresponding predefined original position and original size, a plurality of spacing distances representing ideal spacing distances between the at least one user-content component and corresponding one or more others of the individually-specified components; one or more processors configured to receive and insert at least some user content into at least one user-content component of a user document constructed based on the template document; one or more processors configured to determine current spacing distances between the at least one user-content component and the corresponding one or more others of the individually-specified components in the user document; one or more processors configured to generate an energy model of the layout of the user document based on the ideal spacing distances from the template document and the current spacing distances in the user document, wherein the energy model models the spacing distances between the at least one user-content component and the corresponding one or more others of the individually-specified components as deformable springs in a closed system, the energy model having a calculated deformation energy for each deformable spring representing an amount the distance between the respective at least one user-content component and a corresponding other of the individually-specified components diverges from the corresponding ideal spacing distance determined from the template document, the energy model further having at least one constraint represented by a calculated at least one of user-content component overlap energy representing how much the at least one user-content component overlaps another user-content component, a background overlap energy representing how much the at least one user-content component overlaps a background component, and a color proximity energy representing how close in color the at least one user-content component is to the color of a background image on which it lies; and one or more processors configured to adjust one or more positions of the at least one user-content components in the user document to minimize the energy of the layout in the user document based on the calculated deformation energy for each deformable spring and the calculated at least one of the user-content component overlap energy, the background overlap energy, and the color proximity energy. 17. The system of claim 10 , wherein the at least one user-content component comprises a text component.