private void fillParamList(List <string> @params, TemplateBody body) { @params.Add(body.Header); body.BodyItems.OrderBy(x => x.Order); foreach (var item in body.BodyItems) { if (item.Visible) { @params.Add(item.Content.ToString()); } } @params.Add(body.Footer); }
public bool GeneratePDFFromTemplate(PDFTemplate TemplateType, TemplateBody Body) { string TemplatePath = getTemplatePath(TemplateType); string TemplateContent = File.ReadAllText(TemplatePath); List <string> Params = new List <string>(); fillParamList(Params, Body); string StringWithParam = string.Format(@TemplateContent, Params.ToArray()); var TemplateCss = File.ReadAllText(gtTemplateCSS(TemplateType)); ExportHTMLToPDF(StringWithParam, @"C:\", TemplateCss); return(true); }
public string BindTmplate(PDFTemplate TemplateName, TemplateBody Body) { throw new NotImplementedException(); }