Neevia Technology Sites:   www.neevia.com  |  docuPub.com  |  www.neeviaPDF.com
:: Home :: Products :: Technical Support :: About Us :: Contact Us
Technical support > Neevia docuPrinter SDK code samples
Example 6: Convert a PowerPoint document into PDF (docuPrinter PowerPoint Macro) from C#  Print Example 

1) Add a reference in your Visual Studio project to docuPrinter library.
To do this:
  • On the Project menu, click Add Reference;
  • On the COM tab, locate docuPrinter Library and then click Select;
  • Click OK in the Add References dialog box to accept your selections.
2) Add a reference in your project to Microsoft PowerPoint.
To do this:
  • On the Project menu, click Add Reference.
  • On the COM tab, locate Microsoft PowerPoint and then click Select.
  • Click OK in the Add References dialog box to accept your selections.
private void button1_Click(object sender, EventArgs e)
{

    string fileToConvert = @"c:\test.ppt";

    docuPrinter.SDK DPSDK = new docuPrinter.SDK();

    DPSDK.DocumentOutputFormat = "PDF";
    DPSDK.DocumentOutputName = "demoPPT";
    DPSDK.DocumentOutputFolder = @"c:\";

    DPSDK.PDFAutoRotatePage = "PageByPage";

    DPSDK.HideSaveAsWindow = true;
    DPSDK.DefaultAction = 1;
    DPSDK.ApplySettings();

    docuPrinter.PowerpointMacro DPPPT = new docuPrinter.PowerpointMacro();
    DPPPT.CTransition = true;
    DPPPT.CHBookmarks = true;
    DPPPT.CInternetLink = true;
    DPPPT.CDocInfo = true;
    int RVal =  DPPPT.ConvertDocument( fileToConvert );

    DPPPT = null;
    DPSDK = null;

    if (RVal != 0) {
      MessageBox.Show("Error while converting the document!!!");
    } else {
      MessageBox.Show("Done converting !!!");
    }

}



Copyright © 1999-2016 Neevia Technology. All Rights Reserved. Home | Products | Technical Support | About Us | Contact Us