Indent Paragraph in Word with NET REST API

In this guide we demonstrate how to WordsApi and ParagraphFormatUpdate can be used to apply a hanging indent to a paragraph in a DOCX document via the Java REST API.

Prerequisite

Steps to Indent the First Line of a Paragraph with Java Low Code API

  1. Create an instance of the WordsApi class to indent paragraphs using the client ID and Secret
  2. Load the source Word file into a byte array for indenting selected text
  3. Create an object of the ParagraphFormatUpdate class and set the desired indentation
  4. Create the UpdateParagraphFormatOnlineRequest object using the input/output Word files and formatting parameters
  5. Call the UpdateParagraphFormatOnline() method to indent the desired paragraph
  6. Save the output stream from the API response into a local file on the disk

The aforementioned steps describe how to add a hanging indent on Word with Java REST API. Commence the process by loading the source Word file, creating the desired format changes using the ParagraphFormatUpdate object, creating the request using the UpdateParagraphFormatOnlineRequest object, and indenting the paragraphs using the UpdateParagraphFormatOnline method. Finally, save the output Word file after adding online indentation to the uploaded file.

Code for Indenting Paragraphs with Java Low Code API

The sample code exhibits how to indent in Word with Java REST API. If you want a hanging indent set the FirstLineIndent parameter to a negative value, otherwise set it to a positive value in points for adding the first line indent. You may use other formatting parameters such as alignment, line spacing, shading, etc., in the ParagraphFormatUpdate class to update the Word files online.

In this topic, we have learned how to indent paragraphs. If you want to learn the process of inserting a paragraph in a Word file, refer to the following article: Insert paragraph in Word with Java REST API.

Keywords: hanging indent on word with NET REST API; how to add a hanging indent in word with Java REST API; how to indent in word with NET REST API; indent paragraph in word with NET REST API.