각주 및 미주 작업
Aspose.Words은 각주 및 미주 작업을 위한 일부 클래스,메서드 및 속성도 제공합니다.
미주 삽입 및 번호 매기기 옵션 설정
단어 문서에 각주 또는 미주를 삽입하려면InsertFootnote방법을 사용하십시오. 이 방법은 각주 또는 미주를 문서에 삽입합니다.
EndnoteOptions및FootnoteOptions클래스는 각주 및 미주에 대한 번호 매기기 옵션을 나타냅니다.
다음 코드 예제에서는 미주를 문서에 삽입하고 번호 매기기 옵션을 설정하는 방법을 보여 줍니다:
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Java | |
Document doc = new Document(dataDir + "TestFile.docx"); | |
DocumentBuilder builder = new DocumentBuilder(doc); | |
builder.write("Some text"); | |
builder.insertFootnote(FootnoteType.ENDNOTE, "Endnote text."); | |
EndnoteOptions option = doc.getEndnoteOptions(); | |
option.setRestartRule(FootnoteNumberingRule.RESTART_PAGE); | |
option.setPosition(EndnotePosition.END_OF_SECTION); | |
dataDir = dataDir + "TestFile_Out.doc"; | |
// Save the document to disk. | |
doc.save(dataDir); |
각주 레이아웃 열 수 설정
Columns속성을 사용하여 각주 레이아웃 열의 수를 설정할 수 있습니다. 이 속성의 값이 0 인 경우 각주 영역은 표시된 페이지의 열 수에 따라 열 수로 서식이 지정됩니다.
다음 코드 예제에서는 각주 레이아웃의 열 수를 설정하는 방법을 보여 줍니다:
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Java | |
Document doc = new Document(dataDir + "TestFile.docx"); | |
//Specify the number of columns with which the footnotes area is formatted. | |
doc.getFootnoteOptions().setColumns(3); | |
dataDir = dataDir + "TestFile_Out.doc"; | |
// Save the document to disk. | |
doc.save(dataDir); |
각주 및EndNote의 위치 설정
각주 위치는 각 페이지의 맨 아래 또는 각 페이지의 텍스트 아래에 있을 수 있습니다. 미주 위치는 섹션의 끝이나 문서의 끝에있을 수 있습니다.
다음 코드 예제에서는 각주 및 미주의 위치를 설정하는 방법을 보여 줍니다:
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Java | |
Document doc = new Document(dataDir + "TestFile.docx"); | |
//Set footnote and endnode position. | |
doc.getFootnoteOptions().setPosition(FootnotePosition.BENEATH_TEXT); | |
doc.getEndnoteOptions().setPosition(EndnotePosition.END_OF_SECTION); | |
dataDir = dataDir + "TestFile_Out.doc"; | |
// Save the document to disk. | |
doc.save(dataDir); |