M B

M B

  • NA
  • 24
  • 0

How to convert Word docx to either Html or PDF from MVC application

Aug 28 2020 2:09 PM

Hi,

I have a requirement in my ASP.NET MVC application where I want to preview Word document(docx) in browser. For this, I am converting Word docx file to PDF using free WordToPDF dll in my application. This dll works fine on my local environment(localhost), I am able to see the PDF in browser. But it is not working on application server. When I published code to server and tried opening preview from server application, the dll method gives error as 'Object reference not set...." and it is not generating the PDF from the docx file at the specified path. Can anyone suggests what could be the cause of this? There is no any support or documentation available for this dll.  

Or can anyone suggest alternative options like:
1. any free tool to convert my Word document to PDF (it should not be dependent on MS Office as I cannot install office on application server)
2. Any tool to convert word document to html?
3. Any solution to preview word document directly in browser
 
Also, do I need to set any special permissions on the doc and pdf files to make them visible from client browser?
 
Please suggest. This is urgent. I have already spent lot of time on this.
 
Thanks.
 

Answers (5)