none
Export to WORD and PDF in ASP.net MVC application RRS feed

  • Question

  • Hi All,

    We are developing ASP.net MVC application. we came across export to word and pdf requirement.

    We are maintaining the word documents in application. based on the user inputs few sections of the word document need to modified, and user can able to download that document in word and PDF formats.

    What are the best ways to achieve this functionality in ASP.net MVC.

    Thanks,

    Sandeep

    • Edited by D.V.Sandeep Raju Tuesday, August 9, 2016 7:02 AM
    • Moved by CoolDadTx Tuesday, August 9, 2016 1:57 PM Office related
    Tuesday, August 9, 2016 7:01 AM

Answers

  • Depends upon what format you need to use. If you are targeting the pre-Open XML formats then you have no choice but to use the Office interop assemblies. This requires licensing and an installed copy of Office. Office and ASP.NET traditionally aren't recommended together but it does work.

    If you are targeting the newer Open XML formats (docx, xslx, etc) then you can use Office interop or the Open XML SDK. The SDK is easier and doesn't require any special licensing. However it is truly an SDK so you'll need to write more code.

    For PDF then most people use iTextSharp or similar. It allows you to work with PDFs.

    Questions related to uploading and downloading files for MVC need to be posted in the ASP.NET forums (http://forums.asp.net).

    Michael Taylor
    http://www.michaeltaylorp3.net


    Tuesday, August 9, 2016 1:56 PM

All replies

  • Depends upon what format you need to use. If you are targeting the pre-Open XML formats then you have no choice but to use the Office interop assemblies. This requires licensing and an installed copy of Office. Office and ASP.NET traditionally aren't recommended together but it does work.

    If you are targeting the newer Open XML formats (docx, xslx, etc) then you can use Office interop or the Open XML SDK. The SDK is easier and doesn't require any special licensing. However it is truly an SDK so you'll need to write more code.

    For PDF then most people use iTextSharp or similar. It allows you to work with PDFs.

    Questions related to uploading and downloading files for MVC need to be posted in the ASP.NET forums (http://forums.asp.net).

    Michael Taylor
    http://www.michaeltaylorp3.net


    Tuesday, August 9, 2016 1:56 PM
  • To do file conversion from Word to PDF, you could use a .NET Word library. This sample provides a solution in C#.


    http://code.msdn.microsoft.com/Manage-Word-documents-in-C-77b23282

    Thursday, November 10, 2016 7:48 AM