You must Sign In to post a response.
  • Category: ASP.NET

    How to convert PPT to PDF in ASP.NET without using 3rd party dlls?

    Hi,
    I want to convert PPT to PDF .When i googled,i found many articles but most of them are using 3rd party dlls which have free trial for 30 days only and need to pay money for full version.I need code which converts PPT to PDF without using these type of dlls.

    Request you to provide me code with full version open source dlls without using free trial versions to convert PPT to PDF.
  • #767186
    Hi,

    You can add the following dll and build the code as you want, "Microsoft.Office.Interop.PowerPoint.dll" this is Microsoft dll, no need to pay money you can download and add it in to your project bin folder, refer below path for more details.
    dotnetvishal.com/2012/12/convert-ppt-to-pdf-using-c.html
    e-iceblue.com/Tutorials/Spire.Presentation/Program-Guide/Conversion/How-to-convert-PPT-to-PDF-in-C.html

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #767187
    hi,
    Make sure that you have Microsoft office 7 installed on your machine.
    Add reference of Microsoft Excel 15.0 Object Library from COM tab to your solution.
    Add reference of Microsoft.Office.Interop.PowerPoint 12.0 Library to your solution.
    Now try this code:

    using Microsoft.Office.Interop.PowerPoint;

    protected void Page_Load(object sender, EventArgs e)
    {
    string szInputFile = @"D:\XYZ\PPTFile.pptx";
    string szOutputFile = @"D:\XYZ\DemoPDF.pdf";
    int Errors = 0;
    Microsoft.Office.Interop.PowerPoint._Application objPPApp = null;
    Presentation objPPDoc = null;
    try
    {
    objPPApp = new Application();
    objPPDoc = objPPApp.Presentations.Open(szInputFile);
    objPPDoc.SaveAs(szOutputFile, PpSaveAsFileType.ppSaveAsPDF);
    }
    catch (Exception ex)
    {
    Console.WriteLine(ex.Message);
    }
    finally
    {
    if ((objPPDoc != null))
    {
    objPPDoc.Close();
    objPPDoc = null;
    }
    if ((objPPApp != null))
    {
    objPPApp.Quit();
    objPPApp = null;
    }
    }
    }

  • #767191
    As others suggested, you can use office interop to convert ppt to pdf, but it requires you to install PowerPoint on system. Apart from it, there are some other alternative ways, such as use some free libraries which do not need you to install PowerPoint. You can use this free one if your document is not huge:

    http://www.e-iceblue.com/Introduce/free-presentation-component.html

    Reference: http://www.e-iceblue.com/Tutorials/Spire.Presentation/Program-Guide/Conversion/How-to-convert-PPT-to-PDF-in-C.html

  • #767219
    Use Interop libraries to convert it to PDF or you can below link ,This is a C # example to convert PPT (PPTX) files into PDF under .Net using MS Office Automation via a free C# PDF library. Only the .Net platform, installed package of MS Office and nothing else.
    https://code.msdn.microsoft.com/Convert-Power-Point-c88aed9d

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]


  • Sign In to post your comments