Zoom

Set the slide scale or fit the slide to the editor viewport.

Set zoom with a scale factor. A value of 1 means 100%; 1.5 means 150%.

Set the scale

These helpers accept the editor exposed by either adapter:

import type { Editor } from '@pptx-editor.dev/core/contracts';

export function setZoomPercent(editor: Editor, percent: number) {
  if (!Number.isFinite(percent)) return;
  editor.setZoom(percent / 100);
}

export function fitSlide(editor: Editor) {
  editor.setZoom('fit');
}

Numeric zoom is clamped from 10% to 400%. Validate user input before passing it to setZoom().

Read the scale

snapshot().zoom gives the effective numeric scale. snapshot().fitZoom tells you whether fit mode is active.

Fit mode follows the available viewport size. Give the editor container an explicit height. See Layout.

Use the built-in controls

The status bar exposes zoom controls in both adapters. The slide surface also handles these shortcuts:

ShortcutAction
Ctrl/Cmd + +Increase the scale.
Ctrl/Cmd + -Decrease the scale.
Ctrl/Cmd + 0Fit the slide.
Ctrl/Cmd + wheelAdjust the scale.

Zoom changes the local view. It does not resize slides or change the saved presentation.

See also