Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/d1aaf38b93ed4beb8a5ce4b1a0e8cd76 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/d1aaf38b93ed4beb8a5ce4b1a0e8cd76 to your computer and use it in GitHub Desktop.
Convert PowerPoint presentations to PDF using C++
Convert PowerPoint presentations to PDF using C++
// 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);
// 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