We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

System.NullReferenceException is thrown when saving compared documents to PDF


we noticed an exception is thrown, when comparing two document versions and saving the result as PDF. In some scenarios, when we our code is slightly different, it was also thrown without saving as PDF but when calling UpdatePageLayout. As this method is invoked automatically whhen saving as PDF I think this is the cause of the issue, when saving as PDF, too.

var lic = new License();

var doc = new Document(@"S:\tmp\oldX2.docx");

doc.Compare(new Document(@"S:\tmp\newX2.docx"), "ConSense", DateTime.Now);



Target Framework: .Net 4.5.2

System information

Edition Windows 10 Business
Version 21H2
Installiert am ‎21.‎07.‎2021
Betriebssystembuild 19044.2364
Leistung Windows Feature Experience Pack 120.2212.4190.0

example files.zip (927.5 KB)

Please let me know if you need any further information.
Thanks for your help,

@Serraniel Thank you for reporting the problem to us. For a sake of correction it has been logged as WORDSNET-24821. We will keep you informed and let you know once it is resolved.