Report Alignments Issue

Hello,
As I have inserted html so alignment is distorting in doc file.
As we are using below code.

 DocumentBuilder RedFlagSummaryBuilder =new DocumentBuilder(worddoc)
 RedFlagDetailsBuilder.ListFormat.ListLevelNumber = 4;
 RedFlagDetailsBuilder.Font.Size = 10;
 RedFlagDetailsBuilder.InsertHtml("<span><b>Details:</b>The oldest classical British and Latin writing had little or no space media 1<div><br></div><div>between words and could be written in https://en.wikipedia.org/wiki/Boustrophedon </div><div><br></div><div><br></div><div><br></div><div>(alternating directions). Over time, text direction (left to right) became standardized<br></div><div><br></div><div>The oldest classical British and Latin writing had little or no space between words and could be written in https://en.wikipedia.org/wiki/Boustrophedon (alternating directions). Over time, text direction (left to right) became standardized<br></div><div><br></div><div>The oldest classical British and Latin writing had little or no space between words and could be written in https://en.wikipedia.org/wiki/Boustrophedon (alternating directions). Over time, text direction (left to right) became standardized<br></div><div>The oldest classical British and Latin writing had little or no space between words and could be written in https://en.wikipedia.org/wiki/Boustrophedon (alternating directions). Over time, text direction (left to right) became standardized<br></div></span>");

Alignment Issue in doc as given below screen shot.

So please suggest how can fix this issue.

@RiteshK10 The behavior is expected since by default Aspose.Words uses formatting specified in HTML while inserting HTML into the document. You can change the behavior by instructing document builder to use it’s own formatting upon inserting HTML. Please try using the following code:

// Specify left indent
builder.ParagraphFormat.LeftIndent = 50;
// Instruct DocumentBuilder to use it's formatting upon inserting HTML
builder.InsertHtml("your html", true);

Hello @alexey.noskov thanks for update.
There is some another issue After using below code number list is generating multiple times. When text is coming in next line please see below screen shot.

// Specify left indent
builder.ParagraphFormat.LeftIndent = 50;
// Instruct DocumentBuilder to use it's formatting upon inserting HTML
builder.InsertHtml("your html", true);

@RiteshK10 This is also expected behavior, since your HTML string contains DIV elements, which are exported to Aspose.Words DOM as paragraphs. Since your target paragraph is is list item, the paragraphs generated using InsertHTML method are also list items. If you need line breaks in the list item, you should use soft line break, i.e. <br /> instead of DIV.