Last active
March 2, 2021 11:36
-
-
Save aspose-com-gists/d1aaf38b93ed4beb8a5ce4b1a0e8cd76 to your computer and use it in GitHub Desktop.
Convert PowerPoint presentations to PDF using C++
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
Convert PowerPoint presentations to PDF using C++ |
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
// The path to the source and output files. | |
const String sourceFilePath = u"SourceDirectory\\SampleSlides.pptx"; | |
const String outputFilePath = u"OutputDirectory\\ConvertToPDFWithAdditionalOptions_out.pdf"; | |
// Instantiate Presentation class that represents PPTX file | |
SharedPtr<Presentation> presentation = MakeObject<Presentation>(sourceFilePath); | |
// Instantiate the PdfOptions class | |
SharedPtr<Aspose::Slides::Export::PdfOptions> pdfOptions = MakeObject <Aspose::Slides::Export::PdfOptions>(); | |
// Show hidden slides in PDF | |
pdfOptions->set_ShowHiddenSlides(true); | |
// Set JPEG Quality | |
pdfOptions->set_JpegQuality(90); | |
// Set Text Compression level | |
pdfOptions->set_TextCompression(PdfTextCompression::Flate); | |
// Define the PDF standard | |
pdfOptions->set_Compliance(PdfCompliance::Pdf15); | |
// Save the presentation as PDF | |
presentation->Save(outputFilePath, Aspose::Slides::Export::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
// The path to the source and output files. | |
const String sourceFilePath = u"SourceDirectory\\SampleSlides.pptx"; | |
const String outputFilePath = u"OutputDirectory\\ConvertToPDF_out.pdf"; | |
// Instantiate Presentation class that represents PPTX file | |
SharedPtr<Presentation> presentation = MakeObject<Presentation>(sourceFilePath); | |
// Save the presentation as PDF | |
presentation->Save(outputFilePath, Aspose::Slides::Export::SaveFormat::Pdf); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment