public void CanCompileOdtDocumentTemplate() { using (var stream = DocumentTestHelper.GetResource(Template1OdtName)) { var odt = OdfDocument.LoadFrom(stream); var template = new OdtTemplate(odt); } }
public SimpleObject() { using (var resStream = DocumentTestHelper.GetResource(PngImagePath)) { var buf = new byte[resStream.Length]; resStream.Read(buf, 0, buf.Length); this.JpegImage = new ImageBlob("jpg", buf); } }
public void CanRenderOdt3Template() { OdfTemplate template; using (var stream = DocumentTestHelper.GetResource(Template3OdtName)) { var odt = OdfDocument.LoadFrom(stream); template = new OdtTemplate(odt); } var dataSet = new TestingDataSet(); var values = new Dictionary <string, object>() { { "table1", dataSet.Table1 }, { "so", dataSet.SimpleObject }, }; var context = new TemplateContext(values); var result = template.Render(context); result.Save(Path.Combine(this.TempPath, "odt-out.odt")); }
public void CanRenderWordMLTemplate() { WordMLTemplate template; using (var stream = DocumentTestHelper.GetResource(Template1OdtName)) { var templateDocument = WordMLDocument.LoadFrom(stream); template = new WordMLTemplate(templateDocument); } var dataSet = new TestingDataSet(); var values = new Dictionary <string, object>() { { "table1", dataSet.Table1 }, { "so", dataSet.SimpleObject }, }; var context = new TemplateContext(values); var result = template.Render(context); result.Save(Path.Combine(this.TempPath, "wordml-out.doc.xml")); }