Last active
February 12, 2020 09:01
-
-
Save aspose-com-gists/d80998365f9fbb69f99b04f642b6caa6 to your computer and use it in GitHub Desktop.
Convert PowerPoint to PDF in C# - Aspose.Slides
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instantiate a Presentation object that represents a PPTX file | |
Presentation presentation = new Presentation("PowerPoint.pptx"); | |
/// Instantiate the PdfOptions class | |
PdfOptions pdfOptions = new PdfOptions(); | |
// Setting PDF password and access permissions | |
pdfOptions.Password = "password"; | |
pdfOptions.AccessPermissions = PdfAccessPermissions.PrintDocument | PdfAccessPermissions.HighQualityPrint; | |
// Save the presentation as PDF | |
presentation.Save("PPTX-to-PDF.pdf", SaveFormat.Pdf, pdfOptions); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instantiate a Presentation object that represents a PPT file | |
Presentation presentation = new Presentation("PowerPoint.ppt"); | |
// Save the presentation as PDF | |
presentation.Save("PPT-to-PDF.pdf", SaveFormat.Pdf); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instantiate a Presentation object that represents a PPTX file | |
Presentation presentation = new Presentation("PowerPoint.pptx"); | |
// Instantiate the PdfOptions class | |
PdfOptions pdfOptions = new PdfOptions(); | |
// Set Jpeg quality | |
pdfOptions.JpegQuality = 90; | |
// Set behavior for metafiles | |
pdfOptions.SaveMetafilesAsPng = true; | |
// Set text compression level | |
pdfOptions.TextCompression = PdfTextCompression.Flate; | |
// Define the PDF standard | |
pdfOptions.Compliance = PdfCompliance.Pdf15; | |
// Save the presentation as PDF | |
presentation.Save("PowerPoint-to-PDF.pdf", SaveFormat.Pdf, pdfOptions); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instantiate a Presentation object that represents a PPTX file | |
Presentation presentation = new Presentation("PowerPoint.pptx"); | |
// Setting array of slides positions | |
int[] slides = { 1, 3 }; | |
// Save the presentation as PDF | |
presentation.Save("PPTX-to-PDF.pdf", slides, SaveFormat.Pdf); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment