I’m trying to merge using the Adam Skelton’s code provided in this thread:
I’ve added an additional comparator to that for checking the style difference because the style bytes thing used in the code is not working for us in some cases.
Now, Please consider the scenario:
Doc1(destination): Heading4 style is not used. It is hidden.
Doc2(source): Heading4 is used and now it is appearing in style set.
Now, when I merged these two doc using the Adam’s code the Heading4 style is not appearing in the style set.
I’m also attaching the documents.
So, If I’m using the keep source formatting option then the merged doc has Heading4 style in the style set.
I’m just guessing Adam’s code is written for documents having probable same set of styles and not considering the case of hidden styles in doc1(destination) which are present in doc2(source).
I’m thinking if there is a method to unhide the hidden style at destination if the node is copied from the source to destination then it will work.
So, I’m guessing the doc1.getStyles().get(“Heading 4”).someMethodToUnhideTheStyle() will work.
Please suggest me what could be done in this case.
Thanks for your inquiry. The ImportDocumentDifferentStylesOnly is workaround of missing feature (WORDSNET-4173 : Consider adding a new import format mode which only creates a new style when conflicting styles are different) which does not work in your shared scenario.
This new option will make a copy of the style only when the styles are actually different. You will be notified via this forum thread once this feature is available.
Ok Tahir. Is there way to un-hide the hidden style?
Thanks for your inquiry. Your query seems to be related with managing styles like Show/Hide/Hide until used. Please check the attached image. Unfortunately, Aspose.Words does not support this feature at the moment. However, I have logged this feature request as WORDSNET-9430 in our issue tracking system. You will be notified via this forum thread once this feature is available. We apologize for your inconvenience.
If your query is not related to managing styles (Show/Hide/Hide until used), please share some more detail about your query. We will then provide you more information on this.