Hi,
How to save html string to word file in MVC
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hussam BarouqaPosted Aug 3, 2017, 10:31 AM
{
string HTMLString = "
Hello WebWorld!
";StreamWriter writer = new StreamWriter(ms);
writer.Write(HTMLString);
writer.Flush();
ms.Position = 0;
var options = new LoadDocumentOptions();
using (var document = DocumentFactory.LoadFromStream(ms, options))
{
using (DocumentConverter documentConverter = new DocumentConverter())
{
var outFile = @"outFile.doc";
var format = DocumentFormat.Doc;
var jobData = DocumentConverterJobs.CreateJobData(document, outFile, format);
jobData.JobName = "conversion job";
var job = documentConverter.Jobs.CreateJob(jobData);
documentConverter.Jobs.RunJob(job);
}
}
}
Nitin BhardwajPosted Jul 21, 2017, 6:49 AM
Hussam BarouqaPosted Jul 20, 2017, 2:00 PM
Nitin BhardwajPosted Jul 19, 2017, 12:38 AM
Leon DPosted Jul 18, 2017, 9:00 PM
Naveen BishtPosted Jul 18, 2017, 10:15 AM