-4

I want to view word files in my website. When using return File(path,"application/msword"); the Word document is directly downloaded. I want to display the Word document without downloading.

How can I convert word to PDF/image file without using a Microsoft.Interop.Word reference?

anaximander
  • 7,083
  • 3
  • 44
  • 62
  • How do you expect to be able to read a Word document without using the interop DLL that Microsoft provide for that purpose? – anaximander Jan 29 '15 at 10:55
  • ya, but in my server word application did not installed so only i'm asking this question – Sankari Sakthivel Jan 29 '15 at 11:03
  • see this thread may it help: [Office documents to PDF][1] [1]: http://stackoverflow.com/questions/7665062/office-documents-to-pdf?rq=1 – Yousef Jun 02 '15 at 13:09

1 Answers1

1

You can't convert a file containing textual/document information to a picture without virtually rendering it or something. And I'm sure that's a bit beyond scope so what you want to do isn't possible. If you want to display word files on the browser, I think the best bet is to convert it to a .pdf and then display it in an easier way, although it's not fast either.

These links may have some bases to help you achieve what you want:

http://www.beansoftware.com/ASP.NET-Tutorials/PDF-View-Custom-Control.aspx https://code.msdn.microsoft.com/windowsapps/Word-file-to-PDF-Conversion-261fd865

In a more complex way, you could use Open Office XML to parse the file and render the relevant contents into the page. Since you want to display the whole document, this might not be the best approach.