The invention discloses a document generation method and
system, and belongs to the field of
document processing software, the method comprises the following steps: in response to a template creation operation, creating a template structure file, a style configuration file and a component
library definition file, the template structure file is used for defining a
logic structure and a to-be-filled area of a target document, and the to-be-filled area is used for defining a to-be-filled area of the target document; the style configuration file is used for defining page
layout of the target document, and the component
library definition file is used for defining available document components of the target document; generating a first document template file based on the template structure file, the style configuration file and the component
library definition file; obtaining a first content
data file generated based on the first document template file, wherein the first content
data file comprises filling content used for filling the to-be-filled area; and synthesizing the target document based on the template structure file, the style configuration file and the first content
data file. According to the method,
standardization of the generated target document can be ensured, and the document maintenance difficulty is reduced.