# PowerPointSlideReader

Reads the slides of a PPTX, PPTM, POTX or PPSX package one at a time without building the presentation model.

Class 

`OfficeIMO.PowerPoint`

**Namespace**

`OfficeIMO.PowerPoint`

**Assembly**

`OfficeIMO.PowerPoint`

**Source revision**

`56dd0d38e0b5` with working tree changes

**Source**

[PowerPointSlideReader.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.PowerPoint/Reading/PowerPointSlideReader.cs#L58)

**Implements**

`IDisposable`

**Modifiers**

sealed

Reads the slides of a PPTX, PPTM, POTX or PPSX package one at a time without building the presentation model. Each slide part is read forward with an XmlReader when its turn comes, so memory stays proportional to one slide and the first slide is available before the rest of the deck is read.

## Inheritance

- object
- PowerPointSlideReader

## Remarks

Text is read as authored on each slide: placeholders that are empty on the slide do not pick up layout or master prompt text, and list markers come from the paragraph's own properties. Text inside SmartArt diagrams, charts and markup-compatibility fallbacks is not read. Relationships are read per slide when the slide is read, not for the whole package when it opens. The package is opened without the repair step a model load applies, so a package whose relationship targets are not valid URIs fails when the part that holds them is read; reads such packages. The reader keeps the package open until it is disposed. A file is opened for shared reading; a caller stream stays open and owned by the caller.

## Usage

Explore 1 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 1

- Method [PowerPointSlideReader.Open](/api/powerpoint/officeimo-powerpoint-powerpointslidereader/#method-open-string)

Filter members 

Show inherited

## Methods

`public void Dispose()` [#](#method-dispose)

[PowerPointSlideReader.cs:195](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.PowerPoint/Reading/PowerPointSlideReader.cs#L195)

Closes the package and any stream the reader opened.

`public IEnumerable<PowerPointExtractChunk> ExtractMarkdownChunks(PowerPointExtractOptions? extract = null, PowerPointExtractChunkingOptions? chunking = null, string? sourcePath = null, CancellationToken cancellationToken = default)` [#](#method-extractmarkdownchunks-officeimo-powerpoint-powerpointextractionextensions-powerpointextractoptions-officeimo-powerpoint-powerpointextractchunkingoptions-string-threading-cancellationtoken)

[PowerPointSlideReader.cs:183](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.PowerPoint/Reading/PowerPointSlideReader.cs#L183)

Extracts slide-aligned Markdown chunks while the slides are read, so each chunk is returned as soon as its slide has been read. The chunks match [PowerPointExtractionExtensions.ExtractMarkdownChunks](/api/powerpoint/officeimo-powerpoint-powerpointextractionextensions/) for the same presentation.

Parameters

**extract OfficeIMO.PowerPoint.PowerPointExtractionExtensions.PowerPointExtractOptions? = null optional**

Notes, tables, hidden shapes and Markdown options.

**chunking OfficeIMO.PowerPoint.PowerPointExtractChunkingOptions? = null optional**

Chunk size options.

**sourcePath string? = null optional**

Optional source path used in chunk identifiers and locations.

**cancellationToken System.Threading.CancellationToken = default optional**

Cancellation checked between slides and shapes.

Returns

`IEnumerable<PowerPointExtractChunk>`

Open 4 overloads

`public static PowerPointSlideReader Open(string path)` [#](#method-open-string)

[PowerPointSlideReader.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.PowerPoint/Reading/PowerPointSlideReader.cs#L58)

Opens a presentation file for streaming slide reads with the default input limits.

Parameters

**path string required**

Path to an Open XML presentation.

Returns

`PowerPointSlideReader`

`public static PowerPointSlideReader Open(Stream stream)` [#](#method-open-io-stream)

[PowerPointSlideReader.cs:62](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.PowerPoint/Reading/PowerPointSlideReader.cs#L62)

Opens a presentation stream for streaming slide reads with the default input limits.

Parameters

**stream System.IO.Stream required**

Readable presentation stream; see [PowerPointSlideReader.Open](/api/powerpoint/officeimo-powerpoint-powerpointslidereader/).

Returns

`PowerPointSlideReader`

`public static PowerPointSlideReader Open(string path, PowerPointLoadOptions? options, CancellationToken cancellationToken)` [#](#method-open-string-officeimo-powerpoint-powerpointloadoptions-threading-cancellationtoken)

[PowerPointSlideReader.cs:75](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.PowerPoint/Reading/PowerPointSlideReader.cs#L75)

Opens a presentation file for streaming slide reads.

Parameters

**path string required**

Path to an Open XML presentation.

**options OfficeIMO.PowerPoint.PowerPointLoadOptions? required**

Input limits: [PowerPointLoadOptions.MaxInputBytes](/api/powerpoint/officeimo-powerpoint-powerpointloadoptions/), DocumentLoadOptions.PackageSecurity and OfficeOpenXmlLoadSettings.MaxCharactersInPart apply as they do to a model load. Passwords and binary PPT input are not supported.

**cancellationToken System.Threading.CancellationToken required**

Cancellation for opening the package.

Returns

`PowerPointSlideReader`

`public static PowerPointSlideReader Open(Stream stream, PowerPointLoadOptions? options, CancellationToken cancellationToken)` [#](#method-open-io-stream-officeimo-powerpoint-powerpointloadoptions-threading-cancellationtoken)

[PowerPointSlideReader.cs:96](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.PowerPoint/Reading/PowerPointSlideReader.cs#L96)

Opens a presentation stream for streaming slide reads.

Parameters

**stream System.IO.Stream required**

Readable presentation stream. A seekable stream is read in place and must stay open and unchanged while the reader is used; a forward-only stream is first copied to memory within [PowerPointLoadOptions.MaxInputBytes](/api/powerpoint/officeimo-powerpoint-powerpointloadoptions/).

**options OfficeIMO.PowerPoint.PowerPointLoadOptions? required**

Input limits, as for [PowerPointSlideReader.Open](/api/powerpoint/officeimo-powerpoint-powerpointslidereader/).

**cancellationToken System.Threading.CancellationToken required**

Cancellation for opening the package.

Returns

`PowerPointSlideReader`

`public IEnumerable<PowerPointSlideContent> ReadSlides(bool includeNotes = true, CancellationToken cancellationToken = default)` [#](#method-readslides-boolean-threading-cancellationtoken)

[PowerPointSlideReader.cs:157](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.PowerPoint/Reading/PowerPointSlideReader.cs#L157)

Reads slides in presentation order. Each slide is read when the enumerator reaches it; nothing is kept after it is returned.

Parameters

**includeNotes bool = true optional**

Reads each slide's speaker notes part. Default: true.

**cancellationToken System.Threading.CancellationToken = default optional**

Cancellation checked between slides and shapes.

Returns

`IEnumerable<PowerPointSlideContent>`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public int SlideCount { get; }` [#](#property-slidecount)

[PowerPointSlideReader.cs:51](https://github.com/EvotecIT/OfficeIMO/blob/56dd0d38e0b526611c1af001c026f8c72600880f/OfficeIMO.PowerPoint/Reading/PowerPointSlideReader.cs#L51)

Number of slides in presentation order.

<!-- PowerForge markdown artifact sha256:B81B8534117260889F9FB614E062C0155FCF17BE95802151EF6157CFF50EAC64 -->
