docx
    Preparing search index...

    Class FootNotes

    Represents the footnotes collection in a WordprocessingML document.

    FootNotes manages all footnotes in a document and automatically creates the required separator and continuation separator footnotes. These special footnotes define the line that separates body text from footnotes and the line used when footnotes continue across pages.

    Reference: http://officeopenxml.com/WPfootnotes.php

    <xsd:complexType name="CT_Footnotes">
    <xsd:sequence maxOccurs="unbounded">
    <xsd:element name="footnote" type="CT_FtnEdn" minOccurs="0"/>
    </xsd:sequence>
    </xsd:complexType>
    // FootNotes is typically managed internally by the Document class
    // Users create footnotes through the Document API
    const doc = new Document({
    sections: [{
    children: [
    new Paragraph({
    children: [
    new TextRun("Text with footnote"),
    new FootnoteReferenceRun(1),
    ],
    }),
    ],
    footnotes: {
    1: {
    children: [new Paragraph("Footnote content")],
    },
    },
    }],
    });

    Hierarchy (View Summary)

    Index
    • get writtenAs(): readonly BaseXmlComponent[] | undefined
      Internal

      The components written in this one's place, one after another, when it can't be written as a single element, such as a run with another run in its children. Undefined when it is written as itself.

      Returns readonly BaseXmlComponent[] | undefined

    • Creates and adds a new footnote to the collection.

      Parameters

      • id: number

        Unique numeric identifier for the footnote

      • paragraph: readonly Paragraph[]

        Array of paragraphs that make up the footnote content

      Returns void