Skip to main content
All docs
V25.2
  • DevExpress Presentation API Library: Specify Slide Size and Orientation

    • 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.

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

    Use Predefined Slide Size

    You can size slides for the following formats:

    using DevExpress.Docs.Presentation;
    
        Presentation 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:

    using DevExpress.Docs.Presentation;
    
        Presentation 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:

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

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