摘要
为了降低生成复杂Word文档的开发难度并减少工作量,提出一种基于Word模板的复杂文档快速生成方法。以Word文档为模板,基于OOXML规范实现Word文档的动态生成,并通过Enjoy模板引擎技术生成主文档部件document.xml,提高了文档生成效率;为解决引入模板引擎造成的模板制作问题,设计一组模板指令,并进行指令规范化以及指令解析处理,开发者可直接通过Word文档生成document.xml文件的Enjoy模板。实验表明,该方法模板制作简单,文档生成效率高,所占内存小,后期维护容易,适用于较大数据量的复杂文档生成,具有较高的实用价值。
To reduce the development difficulty and workload of generating complex Word documents,we present a fast generation method of complex documents based on Word template.It took Word document as a template,realized dynamic generation of Word document based on OOXML specification,and generated main document component document.xml through Enjoy template engine technology,which improved document generation efficiency.In order to solve the template making problem caused by the introduction of template engine,a group of template instructions were designed,and the instructions were standardized and parsed.Developers could directly generate the Enjoy template of document.xml file through Word document.Experiments show that our method is simple in template making,efficient in document generation,small in memory,easy to maintain in the later stage,suitable for complex document generation with large amount of data,and has high practical value.
作者
骆蓉
黄俊
黎茂锋
刘志勤
Luo Rong;Huang Jun;Li Maofeng;Liu Zhiqin(School of Computer Science and Technology,Southwest University of Science and Technology,Mianyang 621010,Sichuan,China)
出处
《计算机应用与软件》
北大核心
2020年第10期57-63,共7页
Computer Applications and Software
基金
国家自然科学基金面上项目(61672438)
四川省教育厅研究项目(18TD0021)
四川省军民融合研究院开发基金项目(2017SCII0220)。