Lax
Lax

Reputation: 113

Convert .doc/.docx file to .htm in server, but no Microsoft Office Installed in server

Need to convert .doc/.docx file to .htm file to display on webpage in my MVC web application. This is working in my local system. There is no Microsoft Office Installed in the server and its restricted to install this in the server. Is there a round-about solution for this? Can I convert .doc file to .htm file without having MS Office installed.

Any suggestions.. Really stuck with this for the past 4 days.. Cant find any solutions. Thanks

Upvotes: 0

Views: 157

Answers (1)

Eugene Astafiev
Eugene Astafiev

Reputation: 49435

Yes, you can. Take a look at the third-party components (for example, Aspose).

Also you may consider using the Open XML SDK. See Welcome to the Open XML SDK 2.5 for Office for more information. But it doesn't support binary files such doc etc.

Be aware, Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution.

You can read more about this in the Considerations for server-side Automation of Office article.

Upvotes: 1

Related Questions