To ensure a timely and accurate response, please ZIP and attach the following resources here for testing:
Your simplified input documents
Aspose.Words 18.12 generated output document showing the undesired behavior
Your expected document showing the correct output. You can create expected document by using MS Word. Please list complete Steps that you used in MS Word to create expected document.
As soon as you get these pieces of information ready, we will start further investigation into your issue and provide you more information. Thanks for your cooperation.
There are ‘OUT.docx’ and ‘Expected.docx’ documents that you have shared. What is the difference between them? It would be great if you please also provide a comparison screenshot highlighting the problematic areas in Aspose.Words generated ‘OUT.docx’ file with respect to your ‘Expected.docx’ and attach it here for our reference. Thanks for your cooperation.
Please look at the attached picture.
The right hand side is expected and the left hand side output of the Aspose.
We expect by adding each document, the numbering is reset.
So I need some kind of command like the following that I call before some appendDocument function and reset the numbering.
Sorry, but this is not the answer, I want to reset the numbering on a specific positions. While you set for the list type to reset the number in every new section. Just look at the picture.
I expect the numbering continues under I, II, III, …
While at the beginning of each of these sections the interior list reset.
The attached List.docx document contains 10 list items of the same list and if you need to reset numbering from 5th element for example, then please use the following code to achieve this:
Document doc = new Document("E:\\temp\\list.docx");
Console.WriteLine(doc.Lists.Count);
// The document contains 10 paragraphs (list items)
// Get first paragraph (first list item)
Paragraph firstItem = doc.FirstSection.Body.FirstParagraph;
// Create copy of list
List listCopy = doc.Lists.AddCopy(firstItem.ListFormat.List);
// Get 5th element
Paragraph item = doc.FirstSection.Body.Paragraphs[4];
// Make the remaining list items part of new List
while (item.IsListItem)
{
item.ListFormat.List = listCopy;
item = item.NextSibling as Paragraph;
if (item == null)
break;
}
Console.WriteLine(doc.Lists.Count);
doc.Save("E:\\temp\\18.12.docx");
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.