![]() Get the fifth paragraph and set hanging indentÄocument.saveToFile("SetParagraphIndents.docx", FileFormat.Docx_2013) ![]() Get the fourth paragraph and set first line indent Get the third paragraph and set right indent ParagraphFormat format = para.getFormat() Paragraph para = section.getParagraphs().get(1) Get the second paragraph and set left indent Section section = document.getSections().get(0) Save the result document using Document.saveToFile() method.Call the methods listed in above table to set paragraph indents with the object.Get the ParagraphFormat object using Paragraph.getFormat() method.Get the desired paragraph by index using () method.Get the desired section by its index using () method.Load a Word document using Document.loadFromFile() method.The following are the steps to set paragraph indents: Sets off the first line of a paragraph by positioning it at the margin, and then indenting each subsequent line of the paragraph. Indents the paragraph on the right by the amount you set. Indents the paragraph on the left by the amount you set. You can use Paragraph.getFormat() method to get the ParagraphFormat object, and then use the following methods to set the corresponding paragraph indents with the object: Indents Spire.Doc for Java provides a ParagraphFormat class to work with paragraph formatting.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |