Hi, in our application, when call ‘AppendDocument’ with KeepDifferentStyles ImportFormaMode, in some document, Aspose.Words crash with error message:
System.NullReferenceException: Object reference not set to an instance of an object.
at Aspose.Words.NodeImporter.a(PR a, PR b, Int32 c)
at Aspose.Words.NodeImporter.a(Paragraph a, Paragraph b)
at Aspose.Words.NodeImporter.a(Node a, Node b)
at Aspose.Words.NodeImporter.b(Node a, Boolean b, ZS c)
at Aspose.Words.NodeImporter.a(CompositeNode a, CompositeNode b, ZS c)
at Aspose.Words.NodeImporter.b(Node a, Boolean b, ZS c)
at Aspose.Words.NodeImporter.a(CompositeNode a, CompositeNode b, ZS c)
at Aspose.Words.NodeImporter.b(Node a, Boolean b, ZS c)
at qT.b(Document a, ImportFormatMode b, ImportFormatOptions c)
at Aspose.Words.Document.AppendDocument(Document srcDoc, ImportFormatMode importFormatMode, ImportFormatOptions importFormatOptions)
at Aspose.Words.Document.AppendDocument(Document srcDoc, ImportFormatMode importFormatMode)
Please see my example application with minimum set of documents I used to reproduce the error.
What we are trying to achieve is to merge multiple different documents to a large singe document for batch print out, and it seems that the KeepDifferentStyles is the best option for us to keep the resulting merged document retains styles from each of the source documents. Otherwise, use other ImportFormatMode doesn’t seems cause crash.
ThanksAsposeMergeStyleError.zip (389.4 KB)