We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Footnote numbers appearing in text are not superscripts- it just appears as a normal text

Hi Team,
I am using the below code for adding footnote but it doesn’t seem working properly.It has following two issues:
1. Footnote numbers appearing in text are not superscripts, it just appears as a normal text.(for ex:

Some text is added.<span style=“font-size:12.0pt;font-family:“Times New Roman”,“serif”;mso-fareast-font-family:
“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:EN-US;
mso-bidi-language:AR-SA”>[1]


<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<w:DoNotOptimizeForBrowser/>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";}

<![endif]–>2. At the end of the page, footnote value/text doesn’t appear with numbered list. for ex::
---------------------------------
Footnote text.

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));
footnote.FirstParagraph.Runs.Add(new Run(doc, “Footnote text.”));


// Save the document.
doc.Save(DataDir + “Section.CreateFootnoteSample Out.doc”);

Please find the attached output word file for the same.

Note: It works when I use InsertFootnote() method of document builder. But due to some reasons, I don’t want to use InsertFootnote() method.

builder.InsertFootnote(FootnoteType.Footnote, “Footnote text.”)

Hi Pradeep,

Thanks for your inquiry. I have tested the scenario and have managed to reproduce the same issue at my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-11017. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Pradeep,

Thanks for your patience. It is to inform you that the issue which are facing is actually not a bug in
Aspose.Words. So, we have closed this issue (WORDSNET-11017) as ‘Not a Bug’.

Please use the following code example to add a footnote to a paragraph in the document without using InsertFootnote method. Hope this helps you.

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 run = new Run(doc, "" + (char)0x2);

run.Font.Position = 5;

run.Font.Size = 6;

footnote.FirstParagraph.Runs.Add(run);

run = new Run(doc, "Footnote text.");

run.Font.Size = 8;

footnote.FirstParagraph.Runs.Add(run);

footnote.Font.Size = 8;

footnote.Font.Superscript = true;

doc.Save(MyDir + "Out.docx");