PowerPoint presentation from template and model
var ppTool = new PPTool();
var template = File.ReadAllBytes(@".\template.pptx");
var result = ppTool.CreateFromTemplate(template, ctx => new {
Title = "Example",
Created = DateTimeOffset.Now,
User = new {
Name = "TestName",
IsActive = true,
Evaluation = 1000000,
},
Items = Enumerable.Range(1, 5).Select(x => $"item#{x}"),
});
var result = ppTool.CreateFromTemplate(template, ctx =>
Enumerable.Range(1, 3).Select(x => new {
CompanyName = $"Company #{x}",
Employees = Enumerable.Range(1, _rnd.Next(4, 12)).Select(xx => new {
Name = $"Employee #{xx}",
Email = $"emp{xx}@company{x}.test",
Birthday = new DateTime(_rnd.Next(1980, 2000), _rnd.Next(1, 12), 1).AddDays(_rnd.Next(0, 30)),
}),
})
);
Presentations: template.pptx , result.pptx