com.aspose.words

Class EndnoteOptions

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

Represents the endnote numbering options for a document or section.

Example:

Shows how to insert endnotes and edit their appearance.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert 3 paragraphs with an endnote at the end of each one
builder.write("Text 1. ");
builder.insertFootnote(FootnoteType.ENDNOTE, "Endnote 1");
builder.write("Text 2. ");
builder.insertFootnote(FootnoteType.ENDNOTE, "Endnote 2");
builder.insertBreak(BreakType.PAGE_BREAK);
builder.write("Text 3. ");
builder.insertFootnote(FootnoteType.ENDNOTE, "Endnote 3", "Custom reference mark");

// Edit the numbering and positioning of endnotes
doc.getEndnoteOptions().setPosition(EndnotePosition.END_OF_DOCUMENT);
doc.getEndnoteOptions().setNumberStyle(NumberStyle.UPPERCASE_ROMAN);
doc.getEndnoteOptions().setRestartRule(FootnoteNumberingRule.CONTINUOUS);
doc.getEndnoteOptions().setStartNumber(1);

doc.save(getArtifactsDir() + "Document.Endnotes.docx");
See Also:
Document.EndnoteOptions, PageSetup.EndnoteOptions

Property Getters/Setters Summary
intgetNumberStyle()
void
setNumberStyle(intvalue)
           Specifies the number format for automatically numbered endnotes. The value of the property is NumberStyle integer constant.
intgetPosition()
void
setPosition(intvalue)
           Specifies the endnotes position. The value of the property is EndnotePosition 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 endnotes.
 

    • Property Getters/Setters Detail

      • getNumberStyle/setNumberStyle

        public int getNumberStyle() / public void setNumberStyle(int value)
        
        Specifies the number format for automatically numbered endnotes. 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 endnotes and edit their appearance.
        Document doc = new Document();
        DocumentBuilder builder = new DocumentBuilder(doc);
        
        // Insert 3 paragraphs with an endnote at the end of each one
        builder.write("Text 1. ");
        builder.insertFootnote(FootnoteType.ENDNOTE, "Endnote 1");
        builder.write("Text 2. ");
        builder.insertFootnote(FootnoteType.ENDNOTE, "Endnote 2");
        builder.insertBreak(BreakType.PAGE_BREAK);
        builder.write("Text 3. ");
        builder.insertFootnote(FootnoteType.ENDNOTE, "Endnote 3", "Custom reference mark");
        
        // Edit the numbering and positioning of endnotes
        doc.getEndnoteOptions().setPosition(EndnotePosition.END_OF_DOCUMENT);
        doc.getEndnoteOptions().setNumberStyle(NumberStyle.UPPERCASE_ROMAN);
        doc.getEndnoteOptions().setRestartRule(FootnoteNumberingRule.CONTINUOUS);
        doc.getEndnoteOptions().setStartNumber(1);
        
        doc.save(getArtifactsDir() + "Document.Endnotes.docx");
      • getPosition/setPosition

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

        Example:

        Shows how to insert endnotes and edit their appearance.
        Document doc = new Document();
        DocumentBuilder builder = new DocumentBuilder(doc);
        
        // Insert 3 paragraphs with an endnote at the end of each one
        builder.write("Text 1. ");
        builder.insertFootnote(FootnoteType.ENDNOTE, "Endnote 1");
        builder.write("Text 2. ");
        builder.insertFootnote(FootnoteType.ENDNOTE, "Endnote 2");
        builder.insertBreak(BreakType.PAGE_BREAK);
        builder.write("Text 3. ");
        builder.insertFootnote(FootnoteType.ENDNOTE, "Endnote 3", "Custom reference mark");
        
        // Edit the numbering and positioning of endnotes
        doc.getEndnoteOptions().setPosition(EndnotePosition.END_OF_DOCUMENT);
        doc.getEndnoteOptions().setNumberStyle(NumberStyle.UPPERCASE_ROMAN);
        doc.getEndnoteOptions().setRestartRule(FootnoteNumberingRule.CONTINUOUS);
        doc.getEndnoteOptions().setStartNumber(1);
        
        doc.save(getArtifactsDir() + "Document.Endnotes.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.

        Not all values are applicable to endnotes. To ascertain which values are applicable see FootnoteNumberingRule.

        Example:

        Shows how to insert endnotes and edit their appearance.
        Document doc = new Document();
        DocumentBuilder builder = new DocumentBuilder(doc);
        
        // Insert 3 paragraphs with an endnote at the end of each one
        builder.write("Text 1. ");
        builder.insertFootnote(FootnoteType.ENDNOTE, "Endnote 1");
        builder.write("Text 2. ");
        builder.insertFootnote(FootnoteType.ENDNOTE, "Endnote 2");
        builder.insertBreak(BreakType.PAGE_BREAK);
        builder.write("Text 3. ");
        builder.insertFootnote(FootnoteType.ENDNOTE, "Endnote 3", "Custom reference mark");
        
        // Edit the numbering and positioning of endnotes
        doc.getEndnoteOptions().setPosition(EndnotePosition.END_OF_DOCUMENT);
        doc.getEndnoteOptions().setNumberStyle(NumberStyle.UPPERCASE_ROMAN);
        doc.getEndnoteOptions().setRestartRule(FootnoteNumberingRule.CONTINUOUS);
        doc.getEndnoteOptions().setStartNumber(1);
        
        doc.save(getArtifactsDir() + "Document.Endnotes.docx");
      • getStartNumber/setStartNumber

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

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

        Example:

        Shows how to insert endnotes and edit their appearance.
        Document doc = new Document();
        DocumentBuilder builder = new DocumentBuilder(doc);
        
        // Insert 3 paragraphs with an endnote at the end of each one
        builder.write("Text 1. ");
        builder.insertFootnote(FootnoteType.ENDNOTE, "Endnote 1");
        builder.write("Text 2. ");
        builder.insertFootnote(FootnoteType.ENDNOTE, "Endnote 2");
        builder.insertBreak(BreakType.PAGE_BREAK);
        builder.write("Text 3. ");
        builder.insertFootnote(FootnoteType.ENDNOTE, "Endnote 3", "Custom reference mark");
        
        // Edit the numbering and positioning of endnotes
        doc.getEndnoteOptions().setPosition(EndnotePosition.END_OF_DOCUMENT);
        doc.getEndnoteOptions().setNumberStyle(NumberStyle.UPPERCASE_ROMAN);
        doc.getEndnoteOptions().setRestartRule(FootnoteNumberingRule.CONTINUOUS);
        doc.getEndnoteOptions().setStartNumber(1);
        
        doc.save(getArtifactsDir() + "Document.Endnotes.docx");