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

    • 2 minutes to read

    Important

    The DevExpress Presentation API Library is currently available as a Community Technology Preview (CTP). Note that we do not recommend that you integrate pre-release libraries into mission-critical software applications. You can try the library and share your feedback so that we can make necessary adjustments before the official release. To start a conversation, submit a ticket via the DevExpress Support Center — we’d love to hear from you.

    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.