Back to Devexpress

DevExpress Presentation API Library: Specify Slide Size and Orientation

officefileapi-405536-presentation-api-slides-size-orientation.md

latest4.2 KB
Original Source

DevExpress Presentation API Library: Specify Slide Size and Orientation

  • Nov 07, 2025
  • 2 minutes to read

Slide size specifies the area that is visible when the slide is presented or printed. Objects on that slide can still be placed outside this visible area.

Obtain Slide Size and Orientation

Use SlideSize.Width, SlideSize.Height and SlideSize.Orientation properties to obtain slide size and orientation information.

csharp
float width = presentation.SlideSize.Width;
float height = presentation.SlideSize.Height;
SlideOrientation slideOrientation = presentation.SlideSize.Orientation;
vb
Dim width = presentation.SlideSize.Width
Dim height = presentation.SlideSize.Height
Dim slideOrientation = presentation.SlideSize.Orientation

Use Predefined Slide Size

You can size slides for the following formats:

csharp
using DevExpress.Docs.Presentation;

    Presentation presentation = new Presentation();
    presentation.SlideSize = new SlideSize(SlideSizeType.A4Paper);
vb
Imports DevExpress.Docs.Presentation

    Dim presentation As Presentation = New Presentation()
    presentation.SlideSize = New SlideSize(SlideSizeType.A4Paper)

For predefined slide sizes, you can also pass the orientation parameter in the constructor. Slides can be displayed in Portrait or Landscape orientation:

csharp
using DevExpress.Docs.Presentation;

    Presentation presentation = new Presentation();
    presentation.SlideSize = new SlideSize(SlideSizeType.A4Paper, SlideOrientation.Portrait);
vb
Imports DevExpress.Docs.Presentation

    Dim presentation As Presentation = New Presentation()
    presentation.SlideSize = New SlideSize(SlideSizeType.A4Paper, SlideOrientation.Portrait)

Set a Custom Size

Use the SlideSize(Single, Single) constructor to set a custom size for slides in Document units:

csharp
using DevExpress.Docs.Presentation;

    Presentation presentation = new Presentation();
    presentation.SlideSize = new SlideSize(1600, 900);
vb
Imports DevExpress.Docs.Presentation

    Dim presentation As Presentation = New Presentation()
    presentation.SlideSize = New SlideSize(1600, 900)

For presentations with custom sized slides, the SlideSize.Type is set to Custom.