This article describes how to insert footnote in Word with NET REST API. You will learn to use Aspose.Words for .NET Cloud SDK to add Word footnote with C# Low Code API. We will discuss various properties of the footnote that can be set before adding it to the document.
Prerequisite
- Create an account and get API credentials
- Download Aspose.Words Cloud SDK for Dotnet to add a footnote in a Word file
- Setup C# solution project with the above SDK for creating endnote
Steps to Add Footnote in Word with C# REST API
- Instantiate the WordsApi object by providing the client ID and secret to insert endnote
- Read the input Word file and store it in a file stream
- Create the FootnoteInsert object by setting various properties
- Create the InsertFootnoteOnlineRequest method by setting the request, FootnoteInsert, and destination file name
- Call the InsertFootnoteOnline method to insert a footnote in the source Word file
- Get output stream from the result and save it on the disk
The aforementioned steps describe how to create a footnote in Word with C# REST API. Commence the process by loading the source Word file into the FileStream object and creating a footnote with the FootnoteInsert class. Use this footnote to create the InsertFootnoteOnlineRequest that you may use finally to create the footnote in the Word file using the InsertFootnoteOnline method.
Code for Creating Footnotes in Word with NET REST API
This sample code exhibits how to add a footnote in Word with C# REST API. The FootnoteInsert class contains various properties such as Position that can be set link to range start node and reference mark. The response of the call contains the Document.TryGetValue() method that returns the resultant Word file into the stream object for saving on the disk or in the database.
In this topic, we have learned the process of adding a footnote in a Word document. If you are looking to replace text in a Word file, refer to the following article: Replace a Word in Word with NET REST API.