Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Apr 19, 2016 10:12 am

Hello,

This doesn't work.. Docx -> html
Code: Select all
            using (MemoryStream sm1 = new MemoryStream())
            {
                document.SaveToStream(sm1, FileFormat.Html);
            }


This does work...... Docx -> PDF

Code: Select all
            using (MemoryStream sm1 = new MemoryStream())
            {
                document.SaveToStream(sm1, FileFormat.PDF);
            }


The error output is as follows...... System.NullReferenceException

One of the doc files is attached so you may replicate the issue.

{System.NullReferenceException: Object reference not set to an instance of an object.
at sprẎ.ᜁ(Image A_0)
at sprẎ.ᜀ(DocPicture A_0)
at sprẎ.ᜄ(Paragraph A_0)
at sprẎ.ᜀ(BodyRegion A_0)
at sprẎ.ᜀ(Section A_0)
at sprẎ.ᜁ(Document A_0)
at sprẎ.ᜁ(Document A_0, String A_1)
at sprẎ.ᜀ(Document A_0, Stream A_1)
at Spire.Doc.Document.SaveToFile(Stream stream, FileFormat fileFormat)
at Spire.Doc.Document.SaveToStream(Stream stream, FileFormat fileFormat)
at PaymentManager.Service.LetterService.CreateLetterText(LetterType type, ContactLetterMergeModel contact) in c:\Users\johnm_000\Desktop\SaasSite\PaymentManager\iCollect Web App\PaymentManager\Service\LetterService.cs:line 219
at PaymentManager.Controllers.FurtherActionController.SendThankYou(Nullable`1 debtId) in c:\Users\johnm_000\Desktop\SaasSite\PaymentManager\iCollect Web App\PaymentManager\Controllers\FurtherActionController.cs:line 207
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.ActionInvocation.InvokeSynchronousActionMethod()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()}

HateSigningUp
 
Posts: 1
Joined: Tue Apr 19, 2016 10:04 am

Wed Apr 20, 2016 3:52 am

Hi,

Thanks for your feedback.
I tested your document with the latest version Spire.Doc Pack (hot fix) Version: 5.6.62. There was not such error when converting docx to html. Please try the version.

Sincerely,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Fri Apr 22, 2016 7:32 am

Hello,

Did you test the version? Has your issue been resolved?
Thanks for your feedback.

Sincerely,
Caroline
E-iceblue support team
User avatar

caroline.zhang
 
Posts: 291
Joined: Mon Mar 07, 2016 9:22 am

Return to Spire.Doc