Edit

Share via


PowerPoint.SlideGetImageOptions interface

Represents the available options when getting an image of a slide.

Remarks

[ API set: PowerPointApi 1.8 ]

Examples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/slide-management/export-import-slide.yaml

// Exports current slide.
await PowerPoint.run(async (context) => {
  const slide = context.presentation.getSelectedSlides().getItemAt(0);
  const slideBase64DataResult = slide.exportAsBase64();
  const imageBase64DataResult = slide.getImageAsBase64({ height: 300 });
  await context.sync();

  localStorage.setItem("exportedSlide", slideBase64DataResult.value);
  localStorage.setItem("exportedSlideImage", imageBase64DataResult.value);

  updateSlideImage(imageBase64DataResult.value);

  console.log("Slide was exported.");
});

Properties

height

The desired height of the resulting image in pixels.

width

The desired width of the resulting image in pixels.

Property Details

height

The desired height of the resulting image in pixels.

height?: number;

Property Value

number

Remarks

[ API set: PowerPointApi 1.8 ]

width

The desired width of the resulting image in pixels.

width?: number;

Property Value

number

Remarks

[ API set: PowerPointApi 1.8 ]