Converting PowerPoint Presentations to PDFs
DynamicPDF converter supports converting Power Point files to PDFs. The following example illustrates converting a Power Point to PDF.
PowerPointConverter
Use the PowerPointConverter class to convert Power Point presentations to PDF. The PowerPointConverter class has properties, methods, and events for conversion.
The PowerPointConverter class supports converting using a file path or using a byte array.
Events include PowerPointConverter.Completed and PowerPointConverter.ProgressChanged events.
PowerPointConversionOptions
Use the PowerPointConversionOptions class to set a PowerPointConverter class's properties. Set properties for the PowerPointConverter class using the PowerPointConversionOptions class.
The PowerPointConversionOptions class has the following properties:
- OutputType,
- PdfA, and
- PowerPointSlideRange.
These properties are in addition to the inherited ConversionOptions class's properties.
Power Point to PDF with Advanced Options
The following example demonstrates using the PowerPointConverter class along with the PowerPointConversionOptions to set advanced options for converting a PPT.
PowerPointConversionOptions powerPointConversionOptions = new PowerPointConversionOptions(PageSize.A4, PageOrientation.Portrait, 36);
HandoutOutputType handout = PowerPointOutputType.Handout;
handout.HandoutPrintOrder = HandoutPrintOrder.Horizontal;
handout.SlidesPerPage = SlidesPerPage.Six;
handout.FrameSlides = true;
powerPointConversionOptions.OutputType = handout;
powerPointConversionOptions.OutputType.PrintHiddenSlide = true;
PowerPointConverter powerPointConverter1 = new PowerPointConverter(@"DocumentA.pptx", powerPointConversionOptions);
powerPointConverter1.Convert(outputPdf);
Dim powerPointConversionOptions As New PowerPointConversionOptions(PageSize.A4, PageOrientation.Portrait, 36)
Dim handout As HandoutOutputType = PowerPointOutputType.Handout
handout.HandoutPrintOrder = HandoutPrintOrder.Horizontal
handout.SlidesPerPage = SlidesPerPage.Six
handout.FrameSlides = True
powerPointConversionOptions.OutputType = handout
powerPointConversionOptions.OutputType.PrintHiddenSlide = True
Dim powerPointConverter1 As New PowerPointConverter("DocumentA.pptx", powerPointConversionOptions)
powerPointConverter1.Convert(outputPdf)