Search code examples
c#pdffile-conversion.docformat-conversion

Convert DOC to PDF Without Interop or Aspose in C# code


I need to convert a document .doc to .pdf without using Microsoft Interop or Aspose cause this code using a licence(Aspose) or need to have Microsoft Office in server(Interop).

How can I do it? Is that possible?


Solution

  • From your question I guess you want the conversion to be done on the server side (you mentioned Aspose.net).

    I searched for tens if not hundreds of libraries, and could not find something, free, for commercial use, that has similar or better quality results then the pricey Aspose.

    That said, you can get decent results for simple documents, using OpenOffice or better yet, LibreOffice.

    Once installed, you can invoke a command line exe with parameters to do the conversion.

    soffice --headless --convert-to pdf filename.doc

    For more information you can either google it, or, if all else fails, read the documentation