Problem with footers and styles when using ImportFormatMode

Hi,

A while ago we had this problem https://forum.aspose.com/t/different-footer-in-generated-document-when-adding-a-footer-to-a-document/16640.

You said

Please use ImportFormatMode.KeepSourceFormatting instead of ImportFormatMode.UseDestinationStyles in InsertHeaderOrFooter method to get the desired output.

This worked, but it caused another problem. When we have 2 documents with the same styles and we try to merge them into a single document we get styles like Normal, Normal_1, Normal_2 in the resulting document.

Is there an option to have the best of both worlds? Still get to solve the old problem but also not have the duplicated StyleName, StyleName_1, StyleName_2 and so on.

@ibmromania,

Thanks for your inquiry. Please try ImportFormatMode.KeepDifferentStyles. This option allows to reuse destination styles if the formatting is identical to the styles in the source document. If the style in destination document is different from the source then it is imported.

Please read the following article. Hope this helps you.
Joining and Appending Documents