Hi I am trying to convert DOCX to PDF conversion in C# Console application.
I found similar questions in stack overflow but didn't get the proper answer means unable to proceed with those approaches.
string strFolderPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location).ToString();
strFolderPath = "E:\\Test\\TestDocument\\TemplateFiller\\";
Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application();
Microsoft.Office.Interop.Word.Document doc = word.Documents.Open(@strFileFullPath);
string strPDFFilePath = strFolderPath + "AcknowledgementLetter.pdf";
doc.Activate();
doc.SaveAs2(@strPDFFilePath, WdSaveFormat.wdFormatPDF);
doc.Close();
- This code is working locally because ms office installed,but in server it is throwing exceptions, because it requires MS office installation.
- iTextSharp is not converting Docx to pdf format.
- installed PDF/XPS exporter, but how to provide the reference not able to get.
Can any body provide sample to convert DOCX to PDF without/with licence(cheaper). and usually how we will achieve this functionality. Kindly respond.