Convert PowerPoint Presentations to SWF Flash in Python via Java

Overview

Aspose.Slides for Python via Java lets you convert PowerPoint presentations to SWF without Microsoft PowerPoint. Use Presentation.save to export the presentation and SwfOptions to configure viewer settings, image quality, and the layout of notes or comments.

Convert Presentations to Flash

Load the source file with Presentation, configure SwfOptions, and save it using SaveFormat.Swf.

The following example exports presentation.pptx to presentation.swf. It disables the embedded viewer with setViewerIncluded and includes speaker notes below the slides using NotesCommentsLayoutingOptions.

import jpype
import asposeslides

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

from asposeslides.api import NotesCommentsLayoutingOptions, NotesPositions, Presentation, SaveFormat, SwfOptions

presentation = Presentation("presentation.pptx")
try:
    layout_options = NotesCommentsLayoutingOptions()
    layout_options.setNotesPosition(NotesPositions.BottomFull)

    swf_options = SwfOptions()
    swf_options.setViewerIncluded(False)
    swf_options.setSlidesLayoutOptions(layout_options)

    presentation.save("presentation.swf", SaveFormat.Swf, swf_options)
finally:
    presentation.dispose()

Before running the example, install Aspose.Slides for Python via Java and place presentation.pptx in the working directory. The JVM is started once per Python process.

The example applies NotesPositions.BottomFull through setNotesPosition and passes the layout to SwfOptions.setSlidesLayoutOptions. To include comments as well, configure NotesCommentsLayoutingOptions.setCommentsPosition before exporting.

FAQ

Can I include hidden slides in the SWF?

Yes. Call SwfOptions.setShowHiddenSlides with True. By default, hidden slides are not exported.

How can I control compression and the final SWF size?

Use SwfOptions.setCompressed to enable or disable compression and SwfOptions.setJpegQuality to adjust JPEG image quality. Lower JPEG quality can reduce file size at the cost of image fidelity.

What is the embedded viewer for, and when should I disable it?

SwfOptions.setViewerIncluded controls whether the generated SWF includes the viewer. Pass False when you need the exported slides without the embedded viewer, as in the example above.

What happens if a source font is missing on the export machine?

You can specify a default regular font with setDefaultRegularFont, inherited by SwfOptions. Choose a font available to the export process; font substitution can change text appearance and layout.