Convert PowerPoint Presentations in Handout Mode Using Python

Introduction

Aspose.Slides for Python via Java allows you to export presentations in handout mode, arranging multiple slides on a single page. This is useful for printing presentation materials for conferences, seminars, and similar events.

Configure the layout through the setSlidesLayoutOptions method. Handout layouts are supported by PdfOptions, RenderingOptions, HtmlOptions, and TiffOptions. Use a HandoutLayoutingOptions object to specify the layout and display settings.

Handout Mode Export

To export a presentation in handout mode, create a HandoutLayoutingOptions instance and assign it to the target export options using setSlidesLayoutOptions.

The following example loads sample.pptx and exports it to PDF with four slides per page in horizontal order. It includes slide numbers and frames around the slides, and excludes comments.

import jpype
import asposeslides

if not jpype.isJVMStarted():
    jpype.startJVM()

from asposeslides.api import HandoutLayoutingOptions, HandoutType, PdfOptions, Presentation, SaveFormat

# Load a presentation.
presentation = Presentation("sample.pptx")
try:
    # Configure the handout layout.
    slides_layout_options = HandoutLayoutingOptions()
    slides_layout_options.setHandout(HandoutType.Handouts4Horizontal)
    slides_layout_options.setPrintSlideNumbers(True)
    slides_layout_options.setPrintFrameSlide(True)
    slides_layout_options.setPrintComments(False)

    pdf_options = PdfOptions()
    pdf_options.setSlidesLayoutOptions(slides_layout_options)

    # Export the presentation to PDF with the chosen layout.
    presentation.save("output.pdf", SaveFormat.Pdf, pdf_options)
finally:
    presentation.dispose()

FAQ

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

Aspose.Slides supports up to nine thumbnails per page. The HandoutType presets provide one, two, three, four, six, or nine slides per page. The four-, six-, and nine-slide presets offer horizontal and vertical ordering.

Can I define a custom grid, such as five or eight slides per page?

No. The number and ordering of thumbnails are controlled by the predefined HandoutType values. Arbitrary grids are not supported by these handout layout settings.

Can I include hidden slides in the handout output?

Yes. Enable hidden slides in the export settings for the target format. For PDF, call PdfOptions.setShowHiddenSlides with True before saving the presentation.