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:
- Widescreen (Default - Widescreen, 13.333x7.5 inches)
- A3Paper (A3 Paper, 297x420 mm)
- A4Paper (A4 Paper, 210x297 mm)
- B4IsoPaper (B4 (ISO) Paper, 250x353 mm)
- B5IsoPaper (B5 (ISO) Paper, 176x250 mm)
- Banner (Banner, 8x1 inches)
- LedgerPaper (Ledger Paper, 11x17 inches)
- LetterPaper (Letter Paper, 8.5x11 inches)
- OnScreen (On-screen Show (4:3), 14x10.5 inches)
- OnScreen16x10 (On-screen Show (16:10), 10x6.25 inches)
- OnScreen16x9 (On-screen Show (16:9), 10x5.625 inches)
- Overhead (Overhead, 10x7.5 inches)
- Slide35mm (35mm Slides, 11.25x7.5 inches)
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
.