Convert PDF to PowerPoint in C++

Export PDFs to PPTX with default settings, image-based slides, or a configured image resolution.

Configure the Aspose.PDF for C++ SDK before running these functions. Pass an existing input file and a writable destination path; create any required output directories first. Each function is an independent example, and its options do not carry over to other examples.

Convert PDF to PPTX

Save the document using PptxSaveOptions.

  1. Open the input PDF as Document.
  2. Create PptxSaveOptions.
  3. Save the result with Document::Save(), passing the output path and options.
#include <Aspose.PDF.Cpp/Document.h>
#include <Aspose.PDF.Cpp/PptxSaveOptions.h>

namespace ConvertingExamples
{
	using namespace System;
	using namespace Aspose::Pdf;

	void ConvertPdfToPptx(String inputFile, String outputFile)
	{
		auto document = MakeObject<Document>(inputFile);
		auto options = MakeObject<PptxSaveOptions>();
		document->Save(outputFile, options);
	}
}

Export slides as images

Set SlidesAsImages to true to export slide content as images.

  1. Open the input PDF as Document.
  2. Create PptxSaveOptions.
  3. Set SlidesAsImages to true in PptxSaveOptions.
  4. Save the result with Document::Save(), passing the output path and options.
#include <Aspose.PDF.Cpp/Document.h>
#include <Aspose.PDF.Cpp/PptxSaveOptions.h>

namespace ConvertingExamples
{
	using namespace System;
	using namespace Aspose::Pdf;

	void ConvertPdfToPptxSlidesAsImages(String inputFile, String outputFile)
	{
		auto document = MakeObject<Document>(inputFile);
		auto options = MakeObject<PptxSaveOptions>();
		options->set_SlidesAsImages(true);
		document->Save(outputFile, options);
	}
}

Set PPTX image resolution

Set ImageResolution to 300. This variant does not enable SlidesAsImages.

  1. Open the input PDF as Document.
  2. Create PptxSaveOptions.
  3. Set ImageResolution to 300 in PptxSaveOptions.
  4. Save the result with Document::Save(), passing the output path and options.
#include <Aspose.PDF.Cpp/Document.h>
#include <Aspose.PDF.Cpp/PptxSaveOptions.h>

namespace ConvertingExamples
{
	using namespace System;
	using namespace Aspose::Pdf;

	void ConvertPdfToPptxImageResolution(String inputFile, String outputFile)
	{
		auto document = MakeObject<Document>(inputFile);
		auto options = MakeObject<PptxSaveOptions>();
		options->set_ImageResolution(300);
		document->Save(outputFile, options);
	}
}