InsertHTML - random leading spaces

Using Aspose.Words 5.0, we are experiencing random leading spaces when using InsertHTML. I’ve attached the snippet of HTML that was inserted and the following reply will contain the resulting document.
The code that performs the insert is just 2 lines:


Attached is the resulting document. The inerted sample starts on page 9 and is labeled with the text
Test Analysis: Behavior Assessment System for Children, Parent Rating Scales-Child
Please let me know what you find…

Hello Binh!
Thank you for asking this.
I tried to insert the given HTML fragment to an empty document and obtained some unexpected spaces as well. The code I was using is the following:

public static void TestRandomSpaces()
    Document doc = new Document();
    DocumentBuilder builder = new DocumentBuilder(doc);
    StreamReader reader = File.OpenText("random_spaces.txt");
    string content = reader.ReadToEnd();

The issue has been logged as #4424 in our defect database. We’ll investigate it and provide more information when it is fixed or some update is available.
As a workaround you can try adding the contents by separate paragraphs.

Great, I’m glad you were able to duplicate. Thanks for the quick response and great customer service!

Any estimates on when #4424 will be fixed?

This issue is still open and I cannot give estimate. Have you tried adding text line by line? We can think about any other workarounds together.
Thank you for understanding,

I am welcome to any workarounds. However, I’m not sure what you mean by line by line. We have a WYSIWYG html editor that emits HTML fragments. These fragments are stored in the DB and read out into a InsertHTML call.
Could this issue be fixed by pre-processing the HTML somehow?

I meant that if your fragment consists of several sentences delimited by
you can try splitting it on them. Of course if fragments can be of any structure this is not a case.
I’ll come back to this issue but not immediately now.

Issue #4424 is fixed in the current codebase. The next hotfix will be available most probably early next week.

Any news on that hotfix?

This issue is already fixed as Viktor mentioned. We will publish the hotfix within week or two. Thanks for your patience.
Best regards.

That’s even sooner. We planned to release on Monday but for technical reasons postponed this to one more day. I hope we release on Tuesday. Note possible difference in time zones.

The issues you have found earlier (filed as 4424) have been fixed in this update.