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

Free Support Forum - aspose.com

Exception with message "Object reference not set to an instance of an object. " at ?.?.?()

Conversion of word file to PDF failed with Aspose.word (ver.10.6). Following is the exception and code snippet. Can you please provide fix asap?
Code:
        public static void ConvertWordToPdf(string sourceFilePath, string destinationFilePath)
    {                     
        Aspose.Words.Document doc = new Aspose.Words.Document(sourceFilePath);
                                doc.Save(destinationFilePath,Aspose.Words.SaveFormat.Pdf);           
        
    }</span><span style="white-space: pre-wrap; ">


Exception:
Timestamp: 1/26/2012 10:43:14 PM
Message: HandlingInstanceID: 64fec8a0-e413-403f-ab95-34e306e0eb73

An exception of type ‘System.NullReferenceException’ occurred and was caught.
2012-01-26 17:43:14Z
System.NullReferenceException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Object reference not set to an instance of an object. Aspose.Words in file: C:\WINDOWS\TEMP\IntraLinks\3c97938c-5bd6-4956-99b4-8d5bbd4f15ae.doc System.Collections.ListDictionaryInternal Boolean 䲢() at Ἕ.䲑.䲢() at Ἕ.䲑.MoveNext() at Ἕ.ӧ.䒵(Document ๗, Ө 㒱) at Aspose.Words.Document.UpdatePageLayout() at Aspose.Words.Document.get_ӧ() at Aspose.Words.Document.SaveToPdf(String fileName) at Intralinks.Common.Utilities.AsposeConverter.ConvertWordToPdf(String sourceFilePath, String destinationFilePath) in c:\ilbuilds\pdfconv\build_trunk\CommonUtilities\AsposeConverter.cs:line 39 at Intralinks.Common.Utilities.CommonUtilities.ConvertOfficeDocsToPDF(String sourceFile, String destinationFolder, Boolean useOriginalFileName) in c:\ilbuilds\pdfconv\build_trunk\CommonUtilities\CommonUtilities.cs:line 1357 Category: Logging Exception Priority: 1 EventId: 100 Severity: Error Title:Enterprise Library Exception Handling Machine: WDPDPF01 Application Domain: ILPDFConversionService.exe Process Id: 3216 Process Name: C:\PDFConvService\WOODDALE.pdfconv\instance2\Release\ILPDFConversionService.exe Win32 Thread Id: 7052 Thread Name: Extended Properties: Product Version - 3.0.24944.0

Hi Viral,

Thanks for your query. Please use the latest version of Aspose.Words for .NET 11.0.0. If you still face problem then please share your document for investigation purposes.