com.aspose.words

Class FootnoteOptions

  • java.lang.Object
    • com.aspose.words.FootnoteOptions
public class FootnoteOptions 
extends java.lang.Object

Represents the footnote numbering options for a document or section.

Example:

Shows how to split the footnote section into a given number of columns.
Document doc = new Document(getMyDir() + "Footnotes and endnotes.docx");

doc.getFootnoteOptions().setColumns(2);
doc.save(getArtifactsDir() + "Document.FootnoteColumns.docx");

Example:

Shows how to insert footnotes, and modify their appearance.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.write("Text 1. ");
builder.insertFootnote(FootnoteType.FOOTNOTE, "Footnote 1");
builder.insertBreak(BreakType.PAGE_BREAK);
builder.write("Text 2. ");
builder.insertFootnote(FootnoteType.FOOTNOTE, "Footnote 2");
builder.write("Text 3. ");
builder.insertFootnote(FootnoteType.FOOTNOTE, "Footnote 3", "Custom reference mark");

doc.getFootnoteOptions().setPosition(FootnotePosition.BENEATH_TEXT);
doc.getFootnoteOptions().setNumberStyle(NumberStyle.UPPERCASE_ROMAN);
doc.getFootnoteOptions().setRestartRule(FootnoteNumberingRule.CONTINUOUS);
doc.getFootnoteOptions().setStartNumber(1);

doc.save(getArtifactsDir() + "InlineStory.Footnotes.docx");
See Also:
Document.FootnoteOptions, PageSetup.FootnoteOptions

Property Getters/Setters Summary
intgetColumns()
void
setColumns(intvalue)
           Specifies the number of columns with which the footnotes area is formatted.
intgetNumberStyle()
void
setNumberStyle(intvalue)
           Specifies the number format for automatically numbered footnotes. The value of the property is NumberStyle integer constant.
intgetPosition()
void
setPosition(intvalue)
           Specifies the footnotes position. The value of the property is FootnotePosition integer constant.
intgetRestartRule()
void
setRestartRule(intvalue)
           Determines when automatic numbering restarts. The value of the property is FootnoteNumberingRule integer constant.
intgetStartNumber()
void
setStartNumber(intvalue)
           Specifies the starting number or character for the first automatically numbered footnotes.
 

    • Property Getters/Setters Detail

      • getColumns/setColumns

        public int getColumns() / public void setColumns(int value)
        
        Specifies the number of columns with which the footnotes area is formatted. If this property has the value of 0, the footnotes area is formatted with a number of columns based on the number of columns on the displayed page. The default value is 0.

        Example:

        Shows how to split the footnote section into a given number of columns.
        Document doc = new Document(getMyDir() + "Footnotes and endnotes.docx");
        
        doc.getFootnoteOptions().setColumns(2);
        doc.save(getArtifactsDir() + "Document.FootnoteColumns.docx");
      • getNumberStyle/setNumberStyle

        public int getNumberStyle() / public void setNumberStyle(int value)
        
        Specifies the number format for automatically numbered footnotes. The value of the property is NumberStyle integer constant.

        Not all number styles are applicable for this property. For the list of applicable number styles see the Insert Footnote or Endnote dialog box in Microsoft Word. If you select a number style that is not applicable, Microsoft Word will revert to a default value.

        Example:

        Shows how to insert footnotes, and modify their appearance.
        Document doc = new Document();
        DocumentBuilder builder = new DocumentBuilder(doc);
        
        builder.write("Text 1. ");
        builder.insertFootnote(FootnoteType.FOOTNOTE, "Footnote 1");
        builder.insertBreak(BreakType.PAGE_BREAK);
        builder.write("Text 2. ");
        builder.insertFootnote(FootnoteType.FOOTNOTE, "Footnote 2");
        builder.write("Text 3. ");
        builder.insertFootnote(FootnoteType.FOOTNOTE, "Footnote 3", "Custom reference mark");
        
        doc.getFootnoteOptions().setPosition(FootnotePosition.BENEATH_TEXT);
        doc.getFootnoteOptions().setNumberStyle(NumberStyle.UPPERCASE_ROMAN);
        doc.getFootnoteOptions().setRestartRule(FootnoteNumberingRule.CONTINUOUS);
        doc.getFootnoteOptions().setStartNumber(1);
        
        doc.save(getArtifactsDir() + "InlineStory.Footnotes.docx");
      • getPosition/setPosition

        public int getPosition() / public void setPosition(int value)
        
        Specifies the footnotes position. The value of the property is FootnotePosition integer constant.

        Example:

        Shows how to insert footnotes, and modify their appearance.
        Document doc = new Document();
        DocumentBuilder builder = new DocumentBuilder(doc);
        
        builder.write("Text 1. ");
        builder.insertFootnote(FootnoteType.FOOTNOTE, "Footnote 1");
        builder.insertBreak(BreakType.PAGE_BREAK);
        builder.write("Text 2. ");
        builder.insertFootnote(FootnoteType.FOOTNOTE, "Footnote 2");
        builder.write("Text 3. ");
        builder.insertFootnote(FootnoteType.FOOTNOTE, "Footnote 3", "Custom reference mark");
        
        doc.getFootnoteOptions().setPosition(FootnotePosition.BENEATH_TEXT);
        doc.getFootnoteOptions().setNumberStyle(NumberStyle.UPPERCASE_ROMAN);
        doc.getFootnoteOptions().setRestartRule(FootnoteNumberingRule.CONTINUOUS);
        doc.getFootnoteOptions().setStartNumber(1);
        
        doc.save(getArtifactsDir() + "InlineStory.Footnotes.docx");
      • getRestartRule/setRestartRule

        public int getRestartRule() / public void setRestartRule(int value)
        
        Determines when automatic numbering restarts. The value of the property is FootnoteNumberingRule integer constant.

        Example:

        Shows how to insert footnotes, and modify their appearance.
        Document doc = new Document();
        DocumentBuilder builder = new DocumentBuilder(doc);
        
        builder.write("Text 1. ");
        builder.insertFootnote(FootnoteType.FOOTNOTE, "Footnote 1");
        builder.insertBreak(BreakType.PAGE_BREAK);
        builder.write("Text 2. ");
        builder.insertFootnote(FootnoteType.FOOTNOTE, "Footnote 2");
        builder.write("Text 3. ");
        builder.insertFootnote(FootnoteType.FOOTNOTE, "Footnote 3", "Custom reference mark");
        
        doc.getFootnoteOptions().setPosition(FootnotePosition.BENEATH_TEXT);
        doc.getFootnoteOptions().setNumberStyle(NumberStyle.UPPERCASE_ROMAN);
        doc.getFootnoteOptions().setRestartRule(FootnoteNumberingRule.CONTINUOUS);
        doc.getFootnoteOptions().setStartNumber(1);
        
        doc.save(getArtifactsDir() + "InlineStory.Footnotes.docx");
      • getStartNumber/setStartNumber

        public int getStartNumber() / public void setStartNumber(int value)
        
        Specifies the starting number or character for the first automatically numbered footnotes.

        This property has effect only when RestartRule is set to FootnoteNumberingRule.CONTINUOUS.

        Example:

        Shows how to insert footnotes, and modify their appearance.
        Document doc = new Document();
        DocumentBuilder builder = new DocumentBuilder(doc);
        
        builder.write("Text 1. ");
        builder.insertFootnote(FootnoteType.FOOTNOTE, "Footnote 1");
        builder.insertBreak(BreakType.PAGE_BREAK);
        builder.write("Text 2. ");
        builder.insertFootnote(FootnoteType.FOOTNOTE, "Footnote 2");
        builder.write("Text 3. ");
        builder.insertFootnote(FootnoteType.FOOTNOTE, "Footnote 3", "Custom reference mark");
        
        doc.getFootnoteOptions().setPosition(FootnotePosition.BENEATH_TEXT);
        doc.getFootnoteOptions().setNumberStyle(NumberStyle.UPPERCASE_ROMAN);
        doc.getFootnoteOptions().setRestartRule(FootnoteNumberingRule.CONTINUOUS);
        doc.getFootnoteOptions().setStartNumber(1);
        
        doc.save(getArtifactsDir() + "InlineStory.Footnotes.docx");