JoinRunsWithSameFormatting does not join the Run nodes with same formatting using Java

I have code like this :

// modified docx  
Document doc1 = new Document(modfied.docx);
Document copy1 = new Document();
copy1.appendDocument(doc1, ImportFormatMode.KEEP_SOURCE_FORMATTING);
copy1.acceptAllRevisions();
copy1.joinRunsWithSameFormatting();
copy1.save("D:/abc.html", SaveFormat.HTML);
// original docx
Document doc2 = new Document(original.docx);
Document copy2 = new Document();
copy2.appendDocument(doc2, ImportFormatMode.KEEP_SOURCE_FORMATTING);
copy2.acceptAllRevisions();
copy2.joinRunsWithSameFormatting();
copy2.save("D:/def.html", SaveFormat.HTML);

Now, abc.html and def.html are becoming different. I just change a part of text.

then, why aspose words is generating two different version of html version of docx.

For example :

In original docx. part of html

<span style="font-family:Calibri">Contracting Party 2 Contact Person </span>

But in modified docx. part of the html

<span style="font-family:Calibri">Contracting Pa</span><span style="font-family:Calibri">rty 2 Contact Person </span>

Note : example shown is unmodified. Still it is changing due to other text change. Why ?

This is urgently needed. I’m using aspose words 16.7.0.0

@abhatta266

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word (modified and original) documents.
  • Please attach the output HTML file that shows the undesired behavior.
  • Please attach the expected output HTML file that shows the desired behavior.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

issue.zip (58.2 KB)

I have added the zip.

Docx contains content control.

Please verify why changing a part of docx is changing the whole document html.

I need modified docx html to be same as original irrespective of the changes done .

@abhatta266

We have tested the scenario using the latest version of Aspose.Words for Java 20.4 and have not found the shared issue. The text “Contracting Party 2 Cell Number” is one span tag. So, please use Aspose.Words for Java 20.4. We have attached the output HTML documents with this post for your kind reference. Docs.zip (9.0 KB)

Can you test with aspose words 16.7.0.0 ? My organization is using it.

Still same problem.

In original html,

<span style="font-family:Calibri">Contracting Party 2 Contact Person </span>

In modified html,

<span style="font-family:Calibri">Contracting Pa</span><span style="font-family:Calibri">rty 2 Contact Person </span>

I have not changed this, then why span changed in modified.html. This is my concern.

Note : I have modified some where else in the document. But why this span tag got affected due to that ?

Expected output :

In original html,

<span style="font-family:Calibri">Contracting Party 2 Contact Person </span></span>

In modified html,

<span style="font-family:Calibri">Contracting Party 2 Contact Person </span></span>

I have updated my question. Accidently, I added the wrong tag.

Particularly check this tag that I have mentioned.

@abhatta266

Please note that we do not provide support for older released versions of Aspose.Words. Moreover, we do not provide any fixes or patches for old versions of Aspose products either. All fixes and new features are always added into new versions of our products.

We always encourage our customers to use the latest version of Aspose.Words as it contains newly introduced features, enhancements and fixes to the issues that were reported earlier.

The html that you provided contains the same issue.

@abhatta266

The text “Contracting Party 2 Cell Number” is one span tag. Could you please share some more detail about the issue? Are you facing this issue with some other paragraph? Please share the screenshot of the issue.

I have updated my question already.

Please ignore this content “Contracting Party 2 Cell Number” - This has no problem in the html. It’s fine. It is in one span tag. :slight_smile:

Please check the following below :

In original html,

<span style="font-family:Calibri">Contracting Party 2 Contact Person </span>

In modified html,

<span style="font-family:Calibri">Contracting Pa</span><span style="font-family:Calibri">rty 2 Contact Person </span>

I have not changed this, then why span changed in modified.html. This is my concern.

Note : I have modified some where else in the document. But why this span tag got affected due to that ?

Expected output :

In original html,

<span style="font-family:Calibri">Contracting Party 2 Contact Person </span></span>

In modified html,

<span style="font-family:Calibri">Contracting Party 2 Contact Person </span></span>

@JockeEren

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-20358 . You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Any updates ? Is it resolved

@JockeEren

We try our best to deal with every customer request in a timely fashion, we unfortunately cannot guarantee a delivery date to every customer issue. We work on issues on a first come, first served basis. We feel this is the fairest and most appropriate way to satisfy the needs of the majority of our customers.

Currently, your issue is pending for analysis and is in the queue. Once we complete the analysis of your issue, we will then be able to provide you an estimate.

1 Like

Ok no problem.

The issues you have found earlier (filed as WORDSNET-20358) have been fixed in this Aspose.Words for .NET 20.6 update and this Aspose.Words for Java 20.6 update.