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

Free Support Forum - aspose.com

Error while converting from Word to PDF

I have created the attached file in Aspose.Words 6.6.0.0. I am able to successfully save this file as Word doc but when I save it as PDF, it blows up. Here is the exception:

ex: { "Object reference not set to an instance of an object." }
System.NullReferenceException: { "Object reference not set to an instance of an object." }
Data: {  System.Collections.ListDictionaryInternal }
HelpLink: Nothing
InnerException: Nothing
Message: "Object reference not set to an instance of an object."
Source: "Aspose.Words"
StackTrace: "
 at ..( )
 at ..( )
 at ..( , Boolean )
 at ..get_()
 at ..( )
 at ..get_()
 at ..( , Int32 )
 at ..(Int32 )
 at ..( , Int32 )
 at ..(Int32 )
 at ..( , )
 at ..( , Int32 )
 at ..(Int32 )
 at ..( , Int32 )
 at ..(Int32 )
 at ..( , )
 at ..( , Int32 )
 at ..(Int32 )
 at ..( , Int32 )
 at ..(Int32 )
 at ..( )
 at ..( , )
 at ..( )
 at ..( , )
 at ..( , )
 at ..( )
 at ..()
 at ..()
 at ..(Document , )
 at Aspose.Words.Document.UpdatePageLayout()
 at Aspose.Words.Document.get_()
 at Aspose.Words.Document.(Stream , String , SaveFormat )
 at Aspose.Words.Document.Save(String fileName, SaveFormat fileFormat)
 at Aspose.Words.Document.Save(String fileName)
 at Delaware.ICIS.TemplateProcessor.TemplateProcessor.SavePopulatedTemplateToHD(Document _asposeTemplateDoc, SaveAs saveO
ption) in C:\Delaware\Delaware.ICIS.TemplateProcessor\TemplateProcessor.vb:line 250
 at Delaware.ICIS.TemplateProcessor.TemplateProcessor.ProcessTemplate(SaveAs saveOption) in C:\Delaware\Delaware.ICIS.TemplateProcessor\TemplateProcessor.vb:line 145"
TargetSite: {System.Reflection.RuntimeMethodInfo}

Hi

Thanks for your inquiry. I cannot reproduce the problem using the latest version of Aspose.Words (7.0.0). You can download this version from here:
https://releases.aspose.com/words/net
Here is the code which I use for testing:

Document doc = new Document("in.docx");
doc.SaveToPdf("out.pdf");

Best regards,