/// <summary> /// 一部执行模板编译、渲染并返回结果 /// </summary> /// <param name="odfPath"></param> /// <returns></returns> public static OdfTemplate RenderTemplate(string odfPath, IDictionary<string, object> context) { var odf = new OdfTemplate(); odf.Load(odfPath); odf.Compile(); var resultDoc = odf.Render(context); return resultDoc as OdfTemplate; }