Convert Presentations in Handout Mode in C#
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 SlidesLayoutOptions
property in the IPdfOptions, IRenderingOptions, IHtmlOptions, and ITiffOptions interfaces.
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.
using var presentation = new Presentation("sample.pptx");
// Set the export options.
var pdfOptions = new PdfOptions
{
SlidesLayoutOptions = new HandoutLayoutingOptions
{
Handout = HandoutType.Handouts4Horizontal, // 4 slides on one page horizontally
PrintSlideNumbers = true, // print slide numbers
PrintFrameSlide = true, // print a frame around slides
PrintComments = false // no comments
}
};
// Export the presentation to PDF with the chosen layout.
presentation.Save("output.pdf", SaveFormat.Pdf, pdfOptions);
SlidesLayoutOptions
property is available only for certain output formats, such as PDF, HTML, TIFF, and when rendering as images.