using System;
using Aspose.Slides;
using Aspose.Slides.Export;

namespace TestSlides
{
    public class PresentationToPdf
    {
        public static void ConvertPresentationToPdf()
        {
            // Initialize a license to convert PPT to PDF
            Aspose.Slides.License licensePresExport= new Aspose.Slides.License();
            licensePresExport.SetLicense("Aspose.Total.lic");

            // Create the Presentation class object to load the PPT file
            Presentation presPPT = new Presentation("NewPresentation.ppt");

            // Create the PdfOptions class object
            PdfOptions exportPdfOptions = new PdfOptions();

            // Define the Jpeg quality for images insides presentation
            exportPdfOptions.JpegQuality = 90;

            // Apply the behavior for metafiles
            exportPdfOptions.SaveMetafilesAsPng = true;

            // Apply the text compression level
            exportPdfOptions.TextCompression = PdfTextCompression.Flate;

            // Set the output the PDF standard
            exportPdfOptions.Compliance = PdfCompliance.Pdf15;

            // Convert Presentation to PDF
            presPPT.Save("PPT-to-PDF.pdf", SaveFormat.Pdf, exportPdfOptions);

        }
    }
}