I am using visualstudio 2010 and I am trying to convert word.docx file to .pdf file and is working fine in local but on run time on server it is showing error as
<
I had long been looking for a solution to these issues and in the end I had to use a third party. I suggest you use a third party like Aspose Aspose.Total for .NET
Aspose.Words for .NET is an advanced class library for .NET that enables you to perform a wide range of document processing tasks directly within your .NET applications.
With Aspose.Words you can generate, modify, convert, render and print documents without using Microsoft Word.
Aspose.Words for .NET supports DOC, OOXML, RTF, HTML, OpenDocument, PDF, XPS, EPUB and many other formats.
This component work perfectly for me and very simple to use. this is an example of convert word to pdf code :
Document doc = new Document(getMyDir() + "Document.doc");
doc.save(getMyDir() + "Document.Doc2PdfSave Out.pdf");