Document layout analysis has been researched for many years. However, there is little work on the reverse of document layout analysis: document layout synthesis, whose goal is to generate logically correct and aesthetically appealing layout given the text/image contents and the flexible layout template. This paper introduces a new automatic document layout synthesis method, which can actively pursue the optimal text block height-width tradeoff simultaneously with the block position adjustment. The key idea is to use a cluster of linear functions to approximate the nonlinear heightwidth curve. Then two-pass Simplex algorithm is used to solve the layout synthesis problem. This method has a wide range of applications, such as Variable Data Printing (VDP), automatic table formatting, and automating document layout ground truth generation.