Last post Aug 19, 2019 11:19 AM by AddWeb Solution
Jan 02, 2019 12:59 PM|aspfun|LINK
How to convert Word file to PDF file?
The code below is working in winform but not in asp.net
Dim appWord As Microsoft.Office.Interop.Word.Application = New Microsoft.Office.Interop.Word.Application
Jan 02, 2019 01:52 PM|Mikesdotnetting|LINK
You need Office (Word) installed on the web server for Office Interop to work. Even then, it is not recommended to use Office Interop on a web server. It has not been designed for that. Consequently, shared hosting companies don't allow it.
There are components that do what you want, but I don't know of any free ones.
Jan 04, 2019 07:06 AM|Leon Davis|LINK
You can try
Spire.Doc for .NET component and use code like:
Document doc = new Document();
//Pass path of Word Document in LoadFromFile method
//Pass Document Name and FileFormat of Document as Parameter in SaveToFile Method
You can also download a free edition of Spire.Doc. Free Spire.Doc for .NET is a Community Edition of the Spire.Doc for .NET, that is a totally free word component for commercial and personal use with some limitations. Visit
this link for more information.
Aug 19, 2019 11:19 AM|AddWeb Solution|LINK
Try this one
using Microsoft.Office.Core;Application app;
public string CreatePDF(string path, string exportDir)
Application app = new Application();
app.DisplayAlerts = WdAlertLevel.wdAlertsNone;
app.Visible = true;
var objPresSet = app.Documents;
var objPres = objPresSet.Open(path, MsoTriState.msoTrue, MsoTriState.msoTrue, MsoTriState.msoFalse);
var pdfFileName = Path.ChangeExtension(path, ".pdf");
var pdfPath = Path.Combine(exportDir, pdfFileName);
pdfPath = null;