Convert Presentations in Handout Mode in JavaScript

Contents
[ ]

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 setSlidesLayoutOptions method in the PdfOptions, RenderingOptions, HtmlOptions, and TiffOptions classes.

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.
let presentation = new asposeSlides.Presentation("sample.pptx");

// Set the export options.
let slidesLayoutOptions = new asposeSlides.HandoutLayoutingOptions();
slidesLayoutOptions.setHandout(asposeSlides.HandoutType.Handouts4Horizontal);  // 4 slides on one page horizontally
slidesLayoutOptions.setPrintSlideNumbers(true);                                // print slide numbers
slidesLayoutOptions.setPrintFrameSlide(true);                                  // print a frame around slides
slidesLayoutOptions.setPrintComments(false);                                   // no comments

let pdfOptions = new asposeSlides.PdfOptions();
pdfOptions.setSlidesLayoutOptions(slidesLayoutOptions);

// Export the presentation to PDF with the chosen layout.
presentation.save("output.pdf", asposeSlides.SaveFormat.Pdf, pdfOptions);
presentation.dispose();