Footnote ve Endnote ile Çalışmak

Aspose.Words ayrıca alt yazılar ve son notlar ile çalışma için bazı sınıflar, yöntemler ve özellikler sağlar.

Endnote Ekle ve Numaralandırma Seçeneklerini Ayarla

Word belgesine bir alt not veya bir sonu not eklemek istiyorsanız, lütfen InsertFootnote yöntemini kullanın. Bu yöntem belgeye bir alt not veya bir sonu not ekler.

EndnoteOptions ve FootnoteOptions sınıfları ayaknotası ve sonnot için numaralandırma seçeneklerini temsil eder.

Aşağıdaki kod örneği bir belgenin içine bir sonnot eklemeyi ve onun numaralandırma seçeneklerini ayarlamayı gösterir:

// 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);

Footnote Düzeni Sütunlarının Sayısını Ayarla

Alt yazı düzeni sütunlarının sayısını Columns özelliğini kullanarak ayarlayabilirsiniz. Bu özellik 0 değerine sahipse, alt yazı alanı görüntülenen sayfa sütunlarına dayalı sütunlarla biçimlendirilir.

Aşağıdaki kod örneği bir alt yazı düzeni için sütun sayısını nasıl ayarlayacağını göstermektedir:

// 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);

Footnot ve Endnotun Konumunu Ayarla

Notun konumu her sayfanın alt tarafında veya her sayfadaki metnin altında olabilir. Sonnotun konumu bölümün sonunda ya da belgenin sonunda olabilir.

Aşağıdaki kod örneği, altnot ve ek notun konumunu nasıl ayarlayacağını göstermektedir":

// 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);