Manage Presentation Zoom in Python via Java
Introduction
PowerPoint zooms let you navigate between specific slides and sections during a slide show. With Aspose.Slides for Python via Java, you can create slide, section, and summary zooms and customize their previews, borders, and transitions.

- To summarize an entire presentation on a single slide, use a Summary Zoom.
- To show selected slides only, use a Slide Zoom.
- To show a single section only, use a Section Zoom.
Slide Zoom
A slide zoom can make your presentation more dynamic, allowing you to navigate freely between slides in any order you choose without interrupting the flow of your presentation. Slide zooms are great for short presentations without many sections, but you can still use them in different presentation scenarios.
Slide zooms let you explore related information from a single overview slide.

For slide zoom objects, Aspose.Slides provides the ZoomImageType enumeration, the ZoomFrame class, and methods on the ShapeCollection class.
Create Zoom Frames
Use ShapeCollection.addZoomFrame to place links to individual slides on an overview slide. This example creates two target slides with distinct backgrounds and labels, then adds a preview of each to the first slide and saves the presentation as PPTX. Frame positions and dimensions are specified in points.
import jpype
import asposeslides
if not jpype.isJVMStarted():
jpype.startJVM()
from asposeslides.api import BackgroundType, FillType, Presentation, SaveFormat, ShapeType
from java.awt import Color
presentation = Presentation()
try:
overview_slide = presentation.getSlides().get_Item(0)
second_slide = presentation.getSlides().addEmptySlide(overview_slide.getLayoutSlide())
third_slide = presentation.getSlides().addEmptySlide(overview_slide.getLayoutSlide())
second_slide.getBackground().setType(BackgroundType.OwnBackground)
second_slide.getBackground().getFillFormat().setFillType(FillType.Solid)
second_slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.CYAN)
text_box = second_slide.getShapes().addAutoShape(ShapeType.Rectangle, 100, 200, 500, 200)
text_box.getTextFrame().setText("Second Slide")
third_slide.getBackground().setType(BackgroundType.OwnBackground)
third_slide.getBackground().getFillFormat().setFillType(FillType.Solid)
third_slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color(189, 183, 107))
text_box = third_slide.getShapes().addAutoShape(ShapeType.Rectangle, 100, 200, 500, 200)
text_box.getTextFrame().setText("Third Slide")
overview_slide.getShapes().addZoomFrame(20, 20, 250, 200, second_slide)
overview_slide.getShapes().addZoomFrame(200, 250, 250, 200, third_slide)
presentation.save("presentation.pptx", SaveFormat.Pptx)
finally:
presentation.dispose()
Create Zoom Frames with Custom Images
Pass a custom image to ShapeCollection.addZoomFrame to replace the target slide’s default preview. This example requires a local image, loads it with Images.fromFile, and adds it to the presentation using ImageCollection.addImage. The resulting frame displays that image while still linking to the second slide.
import jpype
import asposeslides
if not jpype.isJVMStarted():
jpype.startJVM()
from asposeslides.api import BackgroundType, FillType, Images, Presentation, SaveFormat, ShapeType
from java.awt import Color
presentation = Presentation()
try:
overview_slide = presentation.getSlides().get_Item(0)
slide = presentation.getSlides().addEmptySlide(overview_slide.getLayoutSlide())
slide.getBackground().setType(BackgroundType.OwnBackground)
slide.getBackground().getFillFormat().setFillType(FillType.Solid)
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.CYAN)
text_box = slide.getShapes().addAutoShape(ShapeType.Rectangle, 100, 200, 500, 200)
text_box.getTextFrame().setText("Second Slide")
image = Images.fromFile("image.png")
try:
preview_image = presentation.getImages().addImage(image)
finally:
image.dispose()
overview_slide.getShapes().addZoomFrame(20, 20, 300, 200, slide, preview_image)
presentation.save("presentation.pptx", SaveFormat.Pptx)
finally:
presentation.dispose()
Format Zoom Frames
This example customizes two slide zoom frames. It assigns a local image to the first frame through ZoomObject.setZoomImage, and gives the second frame a five-point, dash-dot pink border through Shape.getLineFormat. Passing False to ZoomObject.setShowBackground hides the second frame’s background. A local image is required for the custom preview; both frames retain their slide targets in the saved PPTX.
import jpype
import asposeslides
if not jpype.isJVMStarted():
jpype.startJVM()
from asposeslides.api import BackgroundType, FillType, Images, LineDashStyle, Presentation, SaveFormat, ShapeType
from java.awt import Color
presentation = Presentation()
try:
overview_slide = presentation.getSlides().get_Item(0)
second_slide = presentation.getSlides().addEmptySlide(overview_slide.getLayoutSlide())
third_slide = presentation.getSlides().addEmptySlide(overview_slide.getLayoutSlide())
second_slide.getBackground().setType(BackgroundType.OwnBackground)
second_slide.getBackground().getFillFormat().setFillType(FillType.Solid)
second_slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.CYAN)
text_box = second_slide.getShapes().addAutoShape(ShapeType.Rectangle, 100, 200, 500, 200)
text_box.getTextFrame().setText("Second Slide")
third_slide.getBackground().setType(BackgroundType.OwnBackground)
third_slide.getBackground().getFillFormat().setFillType(FillType.Solid)
third_slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color(189, 183, 107))
text_box = third_slide.getShapes().addAutoShape(ShapeType.Rectangle, 100, 200, 500, 200)
text_box.getTextFrame().setText("Third Slide")
first_zoom_frame = overview_slide.getShapes().addZoomFrame(20, 20, 250, 200, second_slide)
second_zoom_frame = overview_slide.getShapes().addZoomFrame(200, 250, 250, 200, third_slide)
image = Images.fromFile("image.png")
try:
preview_image = presentation.getImages().addImage(image)
finally:
image.dispose()
first_zoom_frame.setZoomImage(preview_image)
second_zoom_frame.getLineFormat().setWidth(5)
second_zoom_frame.getLineFormat().getFillFormat().setFillType(FillType.Solid)
second_zoom_frame.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color(255, 105, 180))
second_zoom_frame.getLineFormat().setDashStyle(LineDashStyle.DashDot)
second_zoom_frame.setShowBackground(False)
presentation.save("presentation.pptx", SaveFormat.Pptx)
finally:
presentation.dispose()
Section Zoom
A section zoom links to a section in your presentation. Use it to revisit a topic or show how different parts of the presentation connect.

For section zoom objects, Aspose.Slides provides the SectionZoomFrame class and methods on the ShapeCollection class.
Create Section Zoom Frames
Create a section with SectionCollection.addSection, then pass the returned section to ShapeCollection.addSectionZoomFrame. This example places a section zoom on the first slide and links it to a section beginning with a colored slide. The frame’s position and dimensions are specified in points, and the presentation is saved as PPTX.
import jpype
import asposeslides
if not jpype.isJVMStarted():
jpype.startJVM()
from asposeslides.api import BackgroundType, FillType, Presentation, SaveFormat
from java.awt import Color
presentation = Presentation()
try:
overview_slide = presentation.getSlides().get_Item(0)
slide = presentation.getSlides().addEmptySlide(overview_slide.getLayoutSlide())
slide.getBackground().getFillFormat().setFillType(FillType.Solid)
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color(154, 205, 50))
slide.getBackground().setType(BackgroundType.OwnBackground)
section = presentation.getSections().addSection("Section 1", slide)
section_zoom_frame = overview_slide.getShapes().addSectionZoomFrame(20, 20, 300, 200, section)
presentation.save("presentation.pptx", SaveFormat.Pptx)
finally:
presentation.dispose()
Create Section Zoom Frames with Custom Images
The image overload of ShapeCollection.addSectionZoomFrame lets you display a custom preview without changing the destination section. This example requires a local image, which is loaded with Images.fromFile and added through ImageCollection.addImage. The saved presentation contains a section zoom on the first slide linked to the newly created section.
import jpype
import asposeslides
if not jpype.isJVMStarted():
jpype.startJVM()
from asposeslides.api import BackgroundType, FillType, Images, Presentation, SaveFormat
from java.awt import Color
presentation = Presentation()
try:
overview_slide = presentation.getSlides().get_Item(0)
slide = presentation.getSlides().addEmptySlide(overview_slide.getLayoutSlide())
slide.getBackground().getFillFormat().setFillType(FillType.Solid)
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color(154, 205, 50))
slide.getBackground().setType(BackgroundType.OwnBackground)
image = Images.fromFile("image.png")
try:
preview_image = presentation.getImages().addImage(image)
finally:
image.dispose()
section = presentation.getSections().addSection("Section 1", slide)
section_zoom_frame = overview_slide.getShapes().addSectionZoomFrame(20, 20, 300, 200, section, preview_image)
presentation.save("presentation.pptx", SaveFormat.Pptx)
finally:
presentation.dispose()
Change a Section Zoom’s Target Section
Use SectionZoomFrame.setTargetSection to redirect an existing section zoom without recreating it. Choose a populated section from the same presentation’s Presentation.getSections collection. Assigning an empty section leaves the current target unchanged, so check Section.getSlidesListOfSection before assigning it. See Manage Slide Sections for more about sections.
The following example loads a presentation file, which must contain multiple populated sections, an existing section zoom named Section navigation, and a section with the unique name Results. It searches all slides for the zoom and finds the destination by name rather than by a collection index that can change when sections are reordered. If names are not unique, use Section.getSectionId to identify the destination instead.
import jpype
import asposeslides
if not jpype.isJVMStarted():
jpype.startJVM()
from asposeslides.api import Presentation, SaveFormat, SectionZoomFrame
presentation = Presentation("section-zoom.pptx")
try:
zoom = None
for slide in presentation.getSlides():
for shape in slide.getShapes():
if isinstance(shape, SectionZoomFrame) and shape.getName() == "Section navigation":
zoom = shape
break
if zoom is not None:
break
target_section = None
for section in presentation.getSections():
if section.getName() == "Results":
target_section = section
break
if zoom is None or target_section is None:
print("The section zoom or destination section was not found.")
elif target_section.getSlidesListOfSection().size() == 0:
print("The destination section is empty.")
else:
current_section = zoom.getTargetSection()
current_name = "" if current_section is None else current_section.getName()
print("Current section: " + str(current_name))
zoom.setTargetSection(target_section)
presentation.save("section-zoom-updated.pptx", SaveFormat.Pptx)
finally:
presentation.dispose()
Format Section Zoom Frames
This example moves and resizes a section zoom to 100 by 75 points, assigns a local image through ZoomObject.setZoomImage, and applies a 2.5-point, dash-dot brown border. It enables ZoomObject.setReturnToParent to return to the originating slide after the section, disables ZoomObject.setShowBackground, and sets ZoomObject.setTransitionDuration to 1.5 seconds. A local image is required for the custom preview.
import jpype
import asposeslides
if not jpype.isJVMStarted():
jpype.startJVM()
from asposeslides.api import BackgroundType, FillType, Images, LineDashStyle, Presentation, SaveFormat
from java.awt import Color
presentation = Presentation()
try:
overview_slide = presentation.getSlides().get_Item(0)
slide = presentation.getSlides().addEmptySlide(overview_slide.getLayoutSlide())
slide.getBackground().getFillFormat().setFillType(FillType.Solid)
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color(154, 205, 50))
slide.getBackground().setType(BackgroundType.OwnBackground)
section = presentation.getSections().addSection("Section 1", slide)
section_zoom_frame = overview_slide.getShapes().addSectionZoomFrame(20, 20, 300, 200, section)
section_zoom_frame.setX(100)
section_zoom_frame.setY(300)
section_zoom_frame.setWidth(100)
section_zoom_frame.setHeight(75)
image = Images.fromFile("image.png")
try:
preview_image = presentation.getImages().addImage(image)
finally:
image.dispose()
section_zoom_frame.setZoomImage(preview_image)
section_zoom_frame.setReturnToParent(True)
section_zoom_frame.setShowBackground(False)
section_zoom_frame.getLineFormat().getFillFormat().setFillType(FillType.Solid)
section_zoom_frame.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color(165, 42, 42))
section_zoom_frame.getLineFormat().setDashStyle(LineDashStyle.DashDot)
section_zoom_frame.getLineFormat().setWidth(2.5)
section_zoom_frame.setTransitionDuration(1.5)
presentation.save("presentation.pptx", SaveFormat.Pptx)
finally:
presentation.dispose()
Summary Zoom
A summary zoom provides an overview of presentation sections. During a slide show, you can use it to jump to a section, skip ahead, or revisit a topic without following the slide order.

For summary zoom objects, Aspose.Slides provides the SummaryZoomFrame, SummaryZoomSection, and SummaryZoomSectionCollection classes and methods on the ShapeCollection class.
Create a Summary Zoom
Use ShapeCollection.addSummaryZoomFrame to create an overview of the presentation’s sections. This example creates four sections with distinct slide backgrounds and adds a summary zoom to the first slide. The frame’s position and dimensions are specified in points, and the resulting overview is saved in a PPTX presentation.
import jpype
import asposeslides
if not jpype.isJVMStarted():
jpype.startJVM()
from asposeslides.api import BackgroundType, FillType, Presentation, SaveFormat
from java.awt import Color
presentation = Presentation()
try:
overview_slide = presentation.getSlides().get_Item(0)
slide = presentation.getSlides().addEmptySlide(overview_slide.getLayoutSlide())
slide.getBackground().getFillFormat().setFillType(FillType.Solid)
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color(165, 42, 42))
slide.getBackground().setType(BackgroundType.OwnBackground)
presentation.getSections().addSection("Section 1", slide)
slide = presentation.getSlides().addEmptySlide(overview_slide.getLayoutSlide())
slide.getBackground().getFillFormat().setFillType(FillType.Solid)
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.CYAN)
slide.getBackground().setType(BackgroundType.OwnBackground)
presentation.getSections().addSection("Section 2", slide)
slide = presentation.getSlides().addEmptySlide(overview_slide.getLayoutSlide())
slide.getBackground().getFillFormat().setFillType(FillType.Solid)
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color(127, 255, 0))
slide.getBackground().setType(BackgroundType.OwnBackground)
presentation.getSections().addSection("Section 3", slide)
slide = presentation.getSlides().addEmptySlide(overview_slide.getLayoutSlide())
slide.getBackground().getFillFormat().setFillType(FillType.Solid)
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color(0, 100, 0))
slide.getBackground().setType(BackgroundType.OwnBackground)
presentation.getSections().addSection("Section 4", slide)
summary_zoom_frame = overview_slide.getShapes().addSummaryZoomFrame(150, 50, 300, 200)
presentation.save("presentation.pptx", SaveFormat.Pptx)
finally:
presentation.dispose()
Add and Remove a Summary Zoom Section
A summary zoom stores its SummaryZoomSection objects in SummaryZoomFrame.getSummaryZoomCollection. This example creates an overview of two sections, adds a third section using SummaryZoomSectionCollection.addSummaryZoomSection, and removes the first section’s entry using SummaryZoomSectionCollection.removeSummaryZoomSection. Removing the entry leaves the presentation section and its slides intact.
import jpype
import asposeslides
if not jpype.isJVMStarted():
jpype.startJVM()
from asposeslides.api import BackgroundType, FillType, Presentation, SaveFormat
from java.awt import Color
presentation = Presentation()
try:
overview_slide = presentation.getSlides().get_Item(0)
slide = presentation.getSlides().addEmptySlide(overview_slide.getLayoutSlide())
slide.getBackground().getFillFormat().setFillType(FillType.Solid)
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color(165, 42, 42))
slide.getBackground().setType(BackgroundType.OwnBackground)
first_section = presentation.getSections().addSection("Section 1", slide)
slide = presentation.getSlides().addEmptySlide(overview_slide.getLayoutSlide())
slide.getBackground().getFillFormat().setFillType(FillType.Solid)
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.CYAN)
slide.getBackground().setType(BackgroundType.OwnBackground)
presentation.getSections().addSection("Section 2", slide)
summary_zoom_frame = overview_slide.getShapes().addSummaryZoomFrame(150, 50, 300, 200)
slide = presentation.getSlides().addEmptySlide(overview_slide.getLayoutSlide())
slide.getBackground().getFillFormat().setFillType(FillType.Solid)
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color(127, 255, 0))
slide.getBackground().setType(BackgroundType.OwnBackground)
third_section = presentation.getSections().addSection("Section 3", slide)
summary_zoom_frame.getSummaryZoomCollection().addSummaryZoomSection(third_section)
summary_zoom_frame.getSummaryZoomCollection().removeSummaryZoomSection(first_section)
presentation.save("presentation.pptx", SaveFormat.Pptx)
finally:
presentation.dispose()
Format Summary Zoom Sections
This example formats the first entry in SummaryZoomFrame.getSummaryZoomCollection, using the zero-based index 0. It requires a local image for ZoomObject.setZoomImage, applies a 1.5-point, dash-dot black border, and sets ZoomObject.setTransitionDuration to 1.5 seconds. Passing False to ZoomObject.setReturnToParent disables the automatic return to the summary slide for this entry.
import jpype
import asposeslides
if not jpype.isJVMStarted():
jpype.startJVM()
from asposeslides.api import BackgroundType, FillType, Images, LineDashStyle, Presentation, SaveFormat
from java.awt import Color
presentation = Presentation()
try:
overview_slide = presentation.getSlides().get_Item(0)
slide = presentation.getSlides().addEmptySlide(overview_slide.getLayoutSlide())
slide.getBackground().getFillFormat().setFillType(FillType.Solid)
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color(165, 42, 42))
slide.getBackground().setType(BackgroundType.OwnBackground)
presentation.getSections().addSection("Section 1", slide)
slide = presentation.getSlides().addEmptySlide(overview_slide.getLayoutSlide())
slide.getBackground().getFillFormat().setFillType(FillType.Solid)
slide.getBackground().getFillFormat().getSolidFillColor().setColor(Color.CYAN)
slide.getBackground().setType(BackgroundType.OwnBackground)
presentation.getSections().addSection("Section 2", slide)
summary_zoom_frame = overview_slide.getShapes().addSummaryZoomFrame(150, 50, 300, 200)
summary_section = summary_zoom_frame.getSummaryZoomCollection().get_Item(0)
image = Images.fromFile("image.png")
try:
preview_image = presentation.getImages().addImage(image)
finally:
image.dispose()
summary_section.setZoomImage(preview_image)
summary_section.setReturnToParent(False)
summary_section.getLineFormat().getFillFormat().setFillType(FillType.Solid)
summary_section.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK)
summary_section.getLineFormat().setDashStyle(LineDashStyle.DashDot)
summary_section.getLineFormat().setWidth(1.5)
summary_section.setTransitionDuration(1.5)
presentation.save("presentation.pptx", SaveFormat.Pptx)
finally:
presentation.dispose()
FAQ
Can I control returning to the ‘parent’ slide after showing the target?
Yes. Call ZoomObject.setReturnToParent with True to return to the originating slide after the target content is shown.
Can I adjust the ‘speed’ or duration of the Zoom transition?
Yes. Use ZoomObject.setTransitionDuration to control the transition duration in seconds.
Are there limits on how many Zoom objects a presentation can contain?
There is no hard API limit documented. Practical limits depend on overall presentation complexity and the viewer’s performance. You can add many Zoom frames, but consider file size and rendering time.