|
1 | 1 | --- |
2 | 2 | title: Create a simple Word document in Java | Syncfusion |
3 | | -description: This section illustrate how to create a new Word document from scratch in Java |
| 3 | +description: This section illustrate how to create a new Word document from scratch in Java using Syncfusion Java Word library (Essential DocIO) |
4 | 4 | platform: java-file-formats |
5 | 5 | control: Word Library |
6 | 6 | documentation: UG |
7 | 7 | --- |
8 | | -# Getting Started |
| 8 | +# Getting Started of Word library (DocIO) |
9 | 9 |
|
10 | 10 | In this page, you can see how to create a simple Word document by using Syncfusion Java Word library APIs. For creating and manipulating a Word document, the following jar files are required to be referenced in your Java application. |
11 | 11 |
|
@@ -176,42 +176,66 @@ Essential DocIO allows you to create simple and multi-level lists. The following |
176 | 176 | {% tabs %} |
177 | 177 |
|
178 | 178 | {% highlight JAVA %} |
179 | | -//Write the default numbered list. |
180 | | -paragraph=section.addParagraph(); |
| 179 | +//Write the default numbered list. |
| 180 | +paragraph = section.addParagraph(); |
181 | 181 | //Set before spacing for paragraph. |
182 | 182 | paragraph.getParagraphFormat().setBeforeSpacing(6); |
183 | 183 | paragraph.appendText("Level 0"); |
184 | | -//Apply the default numbered list formats. |
| 184 | +//Apply the default numbered list formats. |
185 | 185 | paragraph.getListFormat().applyDefNumberedStyle(); |
186 | | -paragraph=section.addParagraph(); |
| 186 | +//Applies list formatting. |
| 187 | +paragraph.getListFormat().getCurrentListLevel().getParagraphFormat().setLeftIndent(36); |
| 188 | +paragraph.getListFormat().getCurrentListLevel().getParagraphFormat().setFirstLineIndent(-18); |
| 189 | +paragraph.getListFormat().getCurrentListLevel().setNumberAlignment(ListNumberAlignment.Left); |
| 190 | +paragraph = section.addParagraph(); |
187 | 191 | paragraph.appendText("Level 1"); |
188 | 192 | //Specify the list format to continue from the last list. |
189 | 193 | paragraph.getListFormat().continueListNumbering(); |
190 | 194 | //Increment the list level. |
191 | 195 | paragraph.getListFormat().increaseIndentLevel(); |
192 | | -paragraph=section.addParagraph(); |
| 196 | +//Applies list formatting. |
| 197 | +paragraph.getListFormat().getCurrentListLevel().getParagraphFormat().setLeftIndent(72); |
| 198 | +paragraph.getListFormat().getCurrentListLevel().getParagraphFormat().setFirstLineIndent(-18); |
| 199 | +paragraph.getListFormat().getCurrentListLevel().setNumberAlignment(ListNumberAlignment.Left); |
| 200 | +paragraph = section.addParagraph(); |
193 | 201 | paragraph.appendText("Level 0"); |
194 | 202 | //Decrement the list level. |
195 | 203 | paragraph.getListFormat().continueListNumbering(); |
196 | 204 | paragraph.getListFormat().decreaseIndentLevel(); |
197 | | -//Write the default bulleted list. |
| 205 | +//Applies list formatting. |
| 206 | +paragraph.getListFormat().getCurrentListLevel().getParagraphFormat().setLeftIndent(36); |
| 207 | +paragraph.getListFormat().getCurrentListLevel().getParagraphFormat().setFirstLineIndent(-18); |
| 208 | +paragraph.getListFormat().getCurrentListLevel().setNumberAlignment(ListNumberAlignment.Left); |
| 209 | +//Write the default bulleted list. |
198 | 210 | section.addParagraph(); |
199 | | -paragraph=section.addParagraph(); |
| 211 | +paragraph = section.addParagraph(); |
200 | 212 | paragraph.appendText("Level 0"); |
201 | 213 | //Apply the default bulleted list formats. |
202 | 214 | paragraph.getListFormat().applyDefBulletStyle(); |
203 | | -paragraph=section.addParagraph(); |
| 215 | +//Applies list formatting. |
| 216 | +paragraph.getListFormat().getCurrentListLevel().getParagraphFormat().setLeftIndent(36); |
| 217 | +paragraph.getListFormat().getCurrentListLevel().getParagraphFormat().setFirstLineIndent(-18); |
| 218 | +paragraph.getListFormat().getCurrentListLevel().setNumberAlignment(ListNumberAlignment.Left); |
| 219 | +paragraph = section.addParagraph(); |
204 | 220 | paragraph.appendText("Level 1"); |
205 | 221 | //Specify the list format to continue from the last list. |
206 | 222 | paragraph.getListFormat().continueListNumbering(); |
207 | 223 | //Increment the list level. |
208 | 224 | paragraph.getListFormat().increaseIndentLevel(); |
209 | | -paragraph=section.addParagraph(); |
| 225 | +//Applies list formatting. |
| 226 | +paragraph.getListFormat().getCurrentListLevel().getParagraphFormat().setLeftIndent(72); |
| 227 | +paragraph.getListFormat().getCurrentListLevel().getParagraphFormat().setFirstLineIndent(-18); |
| 228 | +paragraph.getListFormat().getCurrentListLevel().setNumberAlignment(ListNumberAlignment.Left); |
| 229 | +paragraph = section.addParagraph(); |
210 | 230 | paragraph.appendText("Level 0"); |
211 | 231 | //Specify the list format to continue from the last list. |
212 | 232 | paragraph.getListFormat().continueListNumbering(); |
213 | 233 | //Decrement the list level. |
214 | 234 | paragraph.getListFormat().decreaseIndentLevel(); |
| 235 | +//Applies list formatting. |
| 236 | +paragraph.getListFormat().getCurrentListLevel().getParagraphFormat().setLeftIndent(36); |
| 237 | +paragraph.getListFormat().getCurrentListLevel().getParagraphFormat().setFirstLineIndent(-18); |
| 238 | +paragraph.getListFormat().getCurrentListLevel().setNumberAlignment(ListNumberAlignment.Left); |
215 | 239 | section.addParagraph(); |
216 | 240 | {% endhighlight %} |
217 | 241 |
|
|
0 commit comments