Aspose Rendering Bloat and Arbitrary Divisions

Hi guys,

We are having some trouble with Aspose Word HTML renderings of Word documents.

I’ve enclosed an example rendering in the post.

The problem is that spans in the rendering frequently break individual words or phrases into several HTML segments when it isn’t necessary. For example, the following text features near the top of the enclosed document.

<p style="margin:0pt; text-align:center"><span style="font-family:Arial; font-size:12pt; font-style:italic">(<span style="font-family:Arial; font-size:12pt; font-style:italic">Application no. 28973/11<span style="font-family:Arial; font-size:12pt; font-style:italic">)</p>

Aspose renders it like this:

<span style="font-family: Arial; font-size: 12pt; font-style: italic;">(</span>
<span style="font-family: Arial; font-size: 12pt; font-style: italic;">Application no. 28973/11</span>
<span style="font-family: Arial; font-size: 12pt; font-style: italic;">)</span>

We would like Aspose to render this like:

<span style="font-family: Arial; font-size: 12pt; font-style: italic;">(Application no. 28973/11)</span>

Is this possible?

The current renderings are difficult to search by our HTML parsers and generate much larger HTML conversions than necessary.

Your help would be greatly appreciated.

Hi,

Thanks for your inquiry. Please use the Document.JoinRunsWithSameFormatting method before saving the Word document to HTML. This method joins runs with same formatting in all paragraphs of the document. Please see the code below and let us know if you have any more queries.

Document doc = new Document(MyDir + "in.docx");
doc.JoinRunsWithSameFormatting();
doc.Save(MyDir + "AsposeOut.html");