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

Free Support Forum - aspose.com

Simple test for inserting HTML to a Docx template

As the subject states, I quickly set up a MVC4 web application in Visual Studio 2012. All I wanted was to perform a quick test of inserting HTML to an existing Word (docx) template and send the result to a client browser (IE11 in my case).


Below is my controller in its entirety:

using System.Web;
using System.Web.Mvc;
using Aspose.Words;

namespace MvcAspose.Controllers
{
public class HelloWorldController : Controller
{
public ActionResult Index()
{
return View();
}

public void AsposeTest()
{
Document doc = new Document(@“C:\Temp\WordTemplate.docs”);
DocumentBuilder builder = new DocumentBuilder(doc);
builder.InsertHtml(“

Hello World!

”);

doc.Save(System.Web.HttpContext.Current.Response, “DocumentBuilder.InsertHtml AsposeOut.docx”,
ContentDisposition.Inline,
null);
}
}
}

And when I invoke the ‘AsposeTest’ method, I get a runtime error that says, “Input string was not in a correct format.” which points to the ‘doc.Save(…)’ call. Is there any obvious mistake that I’m not seeing?

Hi Kyung,


Thanks for your inquiry. I tested the scenario and have managed to reproduce the same problem on my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-11249. We will further look into the details of this problem and keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,

Awais, thanks for the reponse. In the mean time, it would be tremendously helpful if you or someone other Aspose staff could help me find an alternative way to accomplish essentially the same task at hand.


As stated in my initial post, all I am trying to do is to insert HTML into an existing Word document template and send the result to the client browser. I spent many hours poring over the API reference but haven’t found any other way to achieve the intended result.

Please advise. Thanks!

Hi Kyung,


Thanks for your inquiry. Our development team has resolved this issue and they have planned to include the fix to your issue in 14.12.0 - Dec 2014 release of Aspose.Words. We will inform you via this thread as soon as a release containing the fix to your issue is published during the first week of Jan 2015.

Best regards,

Awais - Happy new year to you!


It is the second week of January (technically speaking, anyway) and I am just wondering if there will be a release in the near future that contains the fix for the aforementioned issue.

Thanks!
Hi Kyung,

Thanks for being patient. The next release of Aspose.Words is a bit delayed; please expect the release of Aspose.Words 14.12.0 during next week. We will inform you as soon as this release is published. We apologize for your inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-11249) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.