Footnotes and Endnotes
Footnotes and Endnotes
Aspose.Words FOSS for .NET represents footnotes and endnotes with a single Footnote node class distinguished by its FootnoteType property, alongside separate numbering-options and separator classes in the Aspose.Words.Notes namespace.
Reading Footnote and Endnote Content
Footnote is a composite story node — like Body or a table cell, it contains Paragraphs and Tables — that holds the text of one footnote or endnote. Its FootnoteType property (a FootnoteType enum value, Footnote or Endnote) distinguishes which kind it is. ReferenceMark returns the configured reference mark character, ActualReferenceMark returns the mark actually rendered (accounting for automatic numbering), and IsAuto reports whether the mark is auto-numbered. ParentParagraph locates the paragraph in the main document body where the footnote or endnote reference occurs. GetText() extracts the plain-text content of the footnote, mirroring the method available on other story-level nodes.
Configuring Numbering and Position
Numbering and placement behavior are controlled separately for footnotes and endnotes through FootnoteOptions and EndnoteOptions, both implementing the shared IFootnoteOptions interface. FootnoteOptions.Position (a FootnotePosition value — BottomOfPage or BeneathText) and EndnoteOptions.Position (an EndnotePosition value — EndOfSection or EndOfDocument) control where each type is placed. Both expose NumberStyle, StartNumber, and RestartRule (a FootnoteNumberingRule value — Continuous, RestartSection, RestartPage, or Default) to control the numbering sequence. FootnoteOptions additionally exposes Columns, for laying out footnotes at the bottom of the page in multiple columns.
Footnote and Endnote Separators
FootnoteSeparator is a story node holding the content Word draws between the main document body and its footnotes/endnotes — the short horizontal line by default, but it can contain any paragraph content. Its SeparatorType property (a FootnoteSeparatorType value) distinguishes the six separator roles Word defines: FootnoteSeparator, FootnoteContinuationSeparator, FootnoteContinuationNotice, and the endnote equivalents. FootnoteSeparatorCollection provides typed access to all separator nodes in a document via GetByFootnoteSeparatorType(FootnoteSeparatorType).
Tips and Best Practices
- Check
Footnote.FootnoteTypebefore assuming aFootnotenode is a footnote — the same class represents both footnotes and endnotes. - Use
ActualReferenceMarkrather thanReferenceMarkwhen you need the mark as it will actually render, since auto-numbered marks differ from the configured mark character. - Configure
FootnoteOptionsandEndnoteOptionsbefore adding footnote/endnote content so numbering rules apply consistently from the first note. FootnoteSeparatorcontent is rarely customized — most documents rely on Word’s default separator — but it is fully accessible if a document requires a custom continuation notice.
Common Issues
| Issue | Cause | Fix |
|---|---|---|
| Footnote and endnote confused in processing logic | Both use the same Footnote class | Branch on Footnote.FootnoteType |
| Reference mark text doesn’t match rendered output | Used ReferenceMark instead of ActualReferenceMark | Read ActualReferenceMark for the as-rendered mark |
| Numbering restarts unexpectedly per page/section | RestartRule set to RestartPage or RestartSection | Set RestartRule to Continuous for document-wide numbering |
| Footnote columns ignored at bottom of page | FootnoteOptions.Columns not set | Set Columns explicitly on FootnoteOptions |
FAQ
How do I tell a footnote apart from an endnote in code?
Check the FootnoteType property on the Footnote object — it returns FootnoteType.Footnote or FootnoteType.Endnote.
Can footnotes and endnotes have different numbering rules?
Yes — FootnoteOptions and EndnoteOptions are configured independently, each with its own Position, NumberStyle, StartNumber, and RestartRule.
What is FootnoteSeparator used for?
It represents the content Word inserts to visually separate the main document body from its footnotes or endnotes, and the notice shown when a footnote continues onto the next page.
Does Footnote support tables inside the note?
Yes — Footnote exposes a Tables property alongside Paragraphs, since it is a composite story node like the main document body.
API Reference Summary
| Class / Method | Description |
|---|---|
Footnote | Container node for one footnote or endnote’s content |
FootnoteType | Enum: Footnote, Endnote |
FootnoteOptions | Footnote numbering and position settings for a document/section |
EndnoteOptions | Endnote numbering and position settings for a document/section |
FootnotePosition / EndnotePosition | Enums for placement (BottomOfPage/BeneathText, EndOfSection/EndOfDocument) |
FootnoteNumberingRule | Enum controlling when numbering restarts |
FootnoteSeparator | Story node for the footnote/endnote separator content |
FootnoteSeparatorCollection | Typed access to all FootnoteSeparator nodes |
FootnoteSeparatorType | Enum identifying which of the six separator roles a node represents |