Footnote with multiple Styles


#1

Hi,
I would like to create a footnote with multiple styles (Eg: Part of the footnote text is bold, part of it is italic, etc).
Please let me know how to create such a footnote.
Regards,
Vishnu


#2

@vthumatty,

Please ZIP and attach your input Word and expected document showing the desired output here for our reference. You can create expected document by using MS Word. We will then investigate the structure of your expected document and provide you code to achieve the same by using Aspose.Words.


#3

Please find attached a word document containing a footnote with multiple styles like strikethrough, Bold Italics for parts of its text.AsposeExample.zip (16.7 KB)


#4

@vthumatty,

You can meet this requirement by using the following code:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("Some text is added.");

Footnote footnote = new Footnote(doc, FootnoteType.Footnote);
builder.CurrentParagraph.AppendChild(footnote);
footnote.Paragraphs.Add(new Paragraph(doc));

Run bRun = new Run(doc, "Bold text. ");
bRun.Font.Bold = true;

Run stRun = new Run(doc, "StrikeThrough text. ");
stRun.Font.StrikeThrough = true;

footnote.FirstParagraph.Runs.Add(stRun);
footnote.FirstParagraph.Runs.Add(bRun);

builder.Document.Save("E:\\Temp\\18.12.docx");