Hi,
I want to insert footer only on last page of the .rtf file from an HTML template. Is there any way to do that? Currently it adds the footer to all pages.
Following is my code:
var htmlStr = GetHtml(templateModel.BodyTemplate, handlebarModel);
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertHtml(htmlStr);
builder.PageSetup.BottomMargin = ConvertUtil.InchToPoint(Margin);
builder.PageSetup.TopMargin = ConvertUtil.InchToPoint(Margin);
builder.PageSetup.LeftMargin = ConvertUtil.InchToPoint(Margin);
builder.PageSetup.RightMargin = ConvertUtil.InchToPoint(Margin);
builder.PageSetup.FooterDistance = ConvertUtil.InchToPoint(FooterDistance);
var htmlTemplateFooter = GetHtml(templateModel.FooterTemplate, handlebarModel);
builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary);
builder.InsertHtml(htmlTemplateFooter);
doc.Save($"{@"C:\Documents\New folder\AsposeRTF" + DateTime.Now.ToString("MMddyyyyhmmttfff")}.rtf", SaveFormat.Rtf);