Convert PowerPoint Presentations in Handout Mode Using C++

Introduction

Aspose.Slides provides the ability to convert presentations into various formats, including creating handouts for printing in Handout mode. This mode allows you to configure how multiple slides appear on a single page, making it useful for conferences, seminars, and other events. You can enable this mode by setting the set_SlidesLayoutOptions method in the IPdfOptions, IRenderingOptions, IHtmlOptions, and ITiffOptions interfaces.

Handout Mode Export

To configure Handout mode, use the HandoutLayoutingOptions object, which determines how many slides are placed on a single page and other display parameters.

Below is a code example showing how to convert a presentation to PDF in Handout mode.

// Load a presentation.
auto presentation = MakeObject<Presentation>(u"sample.pptx");

// Set the export options.
auto slidesLayoutOptions = MakeObject<HandoutLayoutingOptions>();
slidesLayoutOptions->set_Handout(HandoutType::Handouts4Horizontal);  // 4 slides on one page horizontally
slidesLayoutOptions->set_PrintSlideNumbers(true);                    // print slide numbers
slidesLayoutOptions->set_PrintFrameSlide(true);                      // print a frame around slides
slidesLayoutOptions->set_PrintComments(false);                       // no comments

auto pdfOptions = MakeObject<PdfOptions>();
pdfOptions->set_SlidesLayoutOptions(slidesLayoutOptions);

// Export the presentation to PDF with the chosen layout.
presentation->Save(u"output.pdf", SaveFormat::Pdf, pdfOptions);
presentation->Dispose();

FAQ

What is the maximum number of slide thumbnails per page in Handout mode?

Aspose.Slides supports presets up to 9 thumbnails per page with horizontal or vertical ordering: 1, 2, 3, 4 (horizontal/vertical), 6 (horizontal/vertical), and 9 (horizontal/vertical).

Can I define a custom grid, such as 5 or 8 slides per page?

No. The number and ordering of thumbnails are controlled strictly by the HandoutType enumeration; arbitrary layouts are not supported.

Can I include hidden slides in the Handout output?

Yes. Use the set_ShowHiddenSlides method in the export settings for the target format, such as PdfOptions, HtmlOptions, or TiffOptions.