Append documents with KeepDifferentStyles uses ‘Normal’ style using C#

Hello,

we’ve updated Aspose.Words 17.1 to 20.9. Now we have some issues with appending word documents:

With Aspose.Words 20.9 the option ImportFormatMode.KeepDifferentStyles seems to format ‘normal’-style text of the appended document with the ‘normal’-style of the destination document.

When using the option ImportFormatMode.KeepSourceFormatting some list paragraph styles are not preserved (WORDSNET-19756).

Is there any way to keep all styles and formats with Aspose.Words 20.9?

Thanks and best regards,
Marco

AppendDocumentExample.zip (72.6 KB)

@MarcoFrank1

Could you please share some more detail about your requirement along with expected output document? Please also share the styles that you want to final output document.

Please manually create your expected Word document using Microsoft Word and attach it here for our reference. We will investigate how you want your final Word output be generated like. We will then provide you more information on this along with code.

I have saved the following files in the zip archive above:

  • AsposeAppendDocument.doc : the source document to be appended in the destination document
  • Aspose.17.1.Result.doc : the expected result, as it was with Aspose 17.1
  • Aspose.20.9.Result.doc : the result with Aspose 20.9
  • CodeAspose_17_1_Test.vb, CodeAspose_20_9_Test.vb with the ImportFormatOptions for each version test. The source document is appended twice to the destination document. Once with KeepDifferentStyles and then again with KeepSourceFormatting .
  • AppendDocumentUnexpectedSytleFormat.jpg shows the issues with Aspose 20.9

The jpg file shows the issues with Aspose 20.9 :

  • KeepDifferentStyles: The left side of the jpg file. The Arial font of the source document becomes TimesNewRoman in the destination document. In the first case, the size goes from 10 to 12 . It seems the ‘normal’ style formatting of the destination document is used.
  • KeepSourceFormatting: The left side of the jpg file. The list style is lost ( ListParagraph becomes Normal ) and as a result, the distance to the following paragraph is different.

@MarcoFrank1

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-21101 . You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

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