Sher Azam
Sher Azam

Reputation: 99

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

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?

Upvotes: 5

Views: 10025

Answers (3)

Manoj De Mel
Manoj De Mel

Reputation: 995

I believe you can try one of these 2 solutions to achieve what you want.

  1. Image Magic: http://www.imagemagick.org This is free but to find the correct syntax could be a challenge.

  1. OfficeToPdf: http://www.a-pdf.com/office-to-pdf/index.htm This ($49) library is easy-to-use but requires MS Office installed:

    OfficeToPDF "c:\help.doc" "c:\output\help.pdf"

Upvotes: 0

Francesco Baruchelli
Francesco Baruchelli

Reputation: 7468

I'm not aware of any opensource library capable of doing this. I'm currently using Aspose.Words for .Net. It's not for free, but it can be used to build the word docs, too. I originally bought it to just do this kind of conversion (it was the fastest library that I was able to find, and the one producing the best looking pdf's).

Upvotes: 0

Aghilas Yakoub
Aghilas Yakoub

Reputation: 28990

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();

Upvotes: 1

Related Questions