Click here to Skip to main content
14,774,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How to save html string to word file in .Net Core (MVC6).

What I have tried:

I have html string. it can be save to doc with spire. but In .Net core spire is not compatible.
Posted
Updated 24-Jul-17 0:07am

Besides what Solution 1 suggestions, which won't work in a cross-platform framework. There is an SDK by Microsoft, which you can use in .NET Core, since .NET framework and .NET Core (or .NET Standard) have a different mode of dependencies, and platform support, so they require a bit of "brainstorming" before choosing which to use and where.

Besides, you might also be interested in the following posts,
Creating a Word Document OutputFormatter in ASP.NET Core[^]
Read/Write Word Document in Asp.Net Core | The ASP.NET Forums[^]

One thing to note is, that you need to be very careful about the libraries, when working with these frameworks. They are two different things and support different layout of dependencies, NuGet support and runtimes. Things do look similar, but only on the outside.

Quote:
but In .Net core spire is not compatible.
Same reason, it has to support .NET Standard or .NET Core in order to be usable on .NET Core frameworks.

GitHub - OfficeDev/Open-XML-SDK: Open XML SDK by Microsoft[^]
   
v2
   
Comments
Afzaal Ahmad Zeeshan 24-Jul-17 4:57am
   
Not going to work in .NET Core, and they are not expecting to make such a change to support COM in cross-platform tool, for some very obvious reasons. See this thread.
Richard MacCutchan 24-Jul-17 5:08am
   
Thanks, although the responses in that question are open to interpretation. Typical Microsoft answers, never be definitive. :(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900