PresentationPart
Overview
PresentationPart is a class in Aspose.Slides FOSS for .NET.
Manages the ppt/presentation.xml part of an OPC package. Provides methods to parse presentation structure, add/remove slide and master references, and get/set presentation properties such as slide size and notes size.
This class provides 16 methods for working with PresentationPart objects in .NET programs.
Available methods include: AddMasterReference, AddSlideReference, GetFirstSlideNumber, GetNextMasterId, GetNextSlideId, GetNotesSize, GetSlideRefById, GetSlideRefByRelId, GetSlideSize, Load, ParseMasters, ParseSlides, and 4 additional methods.
All exported members are accessible to any .NET application after installing the Aspose.Slides FOSS for .NET package.
Properties: ElementTree, MasterReferences, PartName, SlideCount, SlideReferences.
Description
PresentationPart is a class in the Aspose.Slides FOSS library for .NET that exposes 16 methods and 5 properties for programmatic use.
The class also provides the MasterReferences property (gets the master references), the ElementTree property (gets the element tree), the SlideReferences property (gets the slide references).
Properties
| Name | Type | Access | Description |
|---|---|---|---|
MasterReferences | List<MasterReference> | Read | Gets the master references. |
ElementTree | XElement? | Read | Gets the element tree. |
SlideReferences | List<SlideReference> | Read | Gets the slide references. |
SlideCount | int | Read | Gets the slide count. |
PartName | string | Read | Gets the part name. |
Methods
| Signature | Description |
|---|---|
Load() | Loads and parses the presentation.xml from the package. |
ParseSlides() | Parses slide references from the presentation XML. |
ParseMasters() | Parses master slide references from the presentation XML. |
GetSlideRefById(slideId: int) | The matching , or null if not found. |
GetSlideRefByRelId(relId: string) | The matching , or null if not found. |
GetNextSlideId() | Generates the next available slide ID. Slide IDs start at 256 by PPTX convention. |
GetNextMasterId() | Generates the next available master/layout slide ID. Master IDs and layout IDs share the same ID space and must all be unique. |
AddMasterReference(relId: string, masterId: int?) | The created . |
AddSlideReference(relId: string, slideId: int?, index: int) | The created . |
RemoveSlideReference(slideId: int) | true if removed, false if not found. |
GetSlideSize() | A tuple of (width, height) in EMUs. |
GetNotesSize() | A tuple of (width, height) in EMUs. |
SetNotesSize(cx: int, cy: int) | Height in EMUs. |
GetFirstSlideNumber() | The first slide number, defaulting to 1. |
SetFirstSlideNumber(number: int) | The first slide number. |
Save() | Saves the presentation.xml back to the package. |