Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to convert docx to pdf in asp.net without MS office installed on server

Tags:

c#

asp.net

I just want to ask is there any way we can convert .docx files into PDFs without MS office installed on my server?

Is there any adobe SDK which can help me to perform this action in ASP.NET?

If there is any free (open source) API please let me know, or any paid which help to achieve this solution?

But first of all is any thing from Adobe to get the solution?

like image 293
Sher Azam Avatar asked Nov 12 '22 20:11

Sher Azam


1 Answers

You can install PDF/XPS exporter

Link : http://www.microsoft.com/en-us/download/details.aspx?id=7

Sample code (Javascript)

var filename = "...\\Test.docx";
var msword = WScript.CreateObject("Word.Application");
msword.Visible = false;
msword.WindowState = 2; // minimized
msword.Documents.Open(filename);
msword.ActiveDocument.SaveAs(filename + ".pdf", 17); // 17 is the magic number for wdFormatPDF
msword.quit();
like image 66
Aghilas Yakoub Avatar answered Nov 15 '22 09:11

Aghilas Yakoub