| PDF documents are widely used as a standard format of exchanging documents between organizations, government sectors and common users etc. So, it may also be required by the developers to convert their presentation files to PDF documents. Realizing this possible requirement, Aspose.Slides for .NET has added the built-in support of converting presentations to PDF documents without using any other component. |
Converting Presentation to PDF
Presentation class that represents the presentation exposes the Save method that can be called by developers to convert the whole presentation into PDF document. Further, different options for creating the PDF are provided by the PdfOptions class such as JpegQuality , TextCompression , Compliance etc. These options can be used to get the desired standard of PDF.
Presentation class that represents the presentation exposes the Save method that can be called by developers to convert the whole presentation into PDF document. Further, different options for creating the PDF are provided by the PdfOptions class such as JpegQuality , TextCompression , Compliance etc. These options can be used to get the desired standard of PDF.
Converting Presentation to PDF using default options
The following example shows how to convert a presentation into PDF document with default options. Default options creates the PDF document with maximum quality.
The following example shows how to convert a presentation into PDF document with default options. Default options creates the PDF document with maximum quality.
Example
[C#]
//Instantiate a Presentation object that represents a PPT file Presentation pres = new Presentation("demo.ppt"); //Saving the presentation to PDF document pres.Save("demo.pdf", Aspose.Slides.Export.SaveFormat.Pdf);
[Visual Basic]
'Instantiate a Presentation object that represents a PPT file Dim pres As Presentation = New Presentation("demo.ppt") 'Saving the presentation to PDF document pres.Save("demo.pdf", Aspose.Slides.Export.SaveFormat.Pdf)
Converting Presentation to PDF using custom options
The following example shows how to convert a presentation into PDF document with customized options as provided by PdfOptions class.
The following example shows how to convert a presentation into PDF document with customized options as provided by PdfOptions class.
Example
[C#]
//Instantiate a Presentation object that represents a PPT file Presentation pres = new Presentation("demo.ppt"); //Instantiate the PdfOptions class Aspose.Slides.Export.PdfOptions opts = new Aspose.Slides.Export.PdfOptions(); //Set Jpeg Quality opts.JpegQuality = 90; //Define behavior for metafiles opts.SaveMetafilesAsPng = true; //Set Text Compression level opts.TextCompression = Aspose.Slides.Export.PdfTextCompression.Flate; //Define the PDF standard opts.Compliance = Aspose.Slides.Export.PdfCompliance.Pdf15; //Save the prsentation to PDF with specified options pres.Save("demo.pdf", Aspose.Slides.Export.SaveFormat.Pdf,opts);
[Visual Basic]
'Instantiate a Presentation object that represents a PPT file Dim pres As Presentation = New Presentation("demo.ppt") 'Instantiate the PdfOptions class Dim opts As Aspose.Slides.Export.PdfOptions = New Aspose.Slides.Export.PdfOptions() 'Set Jpeg Quality opts.JpegQuality = 90; 'Define behavior for metafiles opts.SaveMetafilesAsPng = true; 'Set Text Compression level opts.TextCompression = Aspose.Slides.Export.PdfTextCompression.Flate; 'Define the PDF standard opts.Compliance = Aspose.Slides.Export.PdfCompliance.Pdf15; 'Save the prsentation to PDF with specified options pres.Save("demo.pdf", Aspose.Slides.Export.SaveFormat.Pdf,opts);
