We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Prefixed numbered paragraphs


I need to generate numbered paragraphs with several Heading styles with normal and custom prefixes and cross references, like:
2. Flow of events
2.1. Basic flow
2.2.1 Step 1
2.2.1 Step 2 [FA1]
2.2 Alternative flows
FA1. Include entity
This flows starts when…
1. The system shows…
2. The actor…
FA2. Change entity
This flows starts when…
1. The system shows…
2. The actor…[FE1]
2.2 Exception flows
FE1. File not found
At the step 2 of FA2, …
1. The system
2. …
I couldn’t find a way to generate headings like FA1, FA2 that can be updated by Word. I’m depending just on this to buy a license.


<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. You can use ListLevel.NumberFormat to specify custom number’s format:


For example, see the following code:

Document doc = new Document();

// Create a list based on one of the Microsoft Word list templates.

List list = doc.getLists().add(ListTemplate.NUMBER_DEFAULT);

// Completely customize one list level.

ListLevel level1 = list.getListLevels().get(0);



// Completely customize yet another list level.

ListLevel level2 = list.getListLevels().get(1);



// Now add some text that uses the list that we created.

// It does not matter when to customize the list - before or after adding the paragraphs.

DocumentBuilder builder = new DocumentBuilder(doc);


builder.writeln("The quick brown fox...");

builder.writeln("The quick brown fox...");


builder.writeln("jumped over the lazy dog.");

builder.writeln("jumped over the lazy dog.");


builder.writeln("The quick brown fox...");



Hope this helps. Please let me know if you need more information, I will be glad to help you.

Best regards,

Thank you for the quick response, and sorry for asking something that is documented.