This guide shows Java REST API developers how to insert a footnote into a Word document using the Aspose.Words Cloud SDK for Java, working with the DOCX format.
Prerequisite
- Create an account and get API credentials
- Download Aspose.Words Cloud SDK for Java to add a footnote in a Word file
- Set up a Java project with the above SDK for creating a footnote
Steps to Add Footnote in Word with Java REST API
- Instantiate the WordsApi object by providing the client ID and secret to insert a footnote
- Read the input Word file and store it in a file stream
- Create the FootnoteInsert object by setting various properties
- Create the InsertFootnoteOnlineRequest by setting the request, FootnoteInsert, and destination file name
- Call the InsertFootnoteOnline method to insert a footnote in the source Word file
- Get the output stream from the result and save it to disk
The steps above describe how to create a footnote in Word with Java REST API. Begin by loading the source Word file into a FileInputStream and creating a footnote with the FootnoteInsert class. Use this footnote to build the InsertFootnoteOnlineRequest, then call InsertFootnoteOnline to embed the footnote in the document.
Code for Creating Footnotes in Word with Java REST API
This sample demonstrates how to add a footnote in Word with Java REST API. The FootnoteInsert class includes properties such as Position, which can be linked to a range start node and reference mark. The response contains the Document.TryGetValue() method that returns the resulting Word file as a stream, ready to be saved to disk or stored in a database.
In this topic, we covered the process of adding a footnote to a Word document. If you need to replace text in a Word file, see the article: Replace a Word in Word with Java REST API.
Keywords: word footnote with Java Low Code API; insert footnote in word with NET REST API; creating footnotes in word with NET REST API; footnote in word document with Java REST API; document with footnotes with Java Low Code API.