# OfficeDocumentReader

Immutable, instance-scoped OfficeIMO document reader suitable for services and concurrent hosts.

Class 

`OfficeIMO.Reader`

**Namespace**

`OfficeIMO.Reader`

**Assembly**

`OfficeIMO.Reader.Core`

**Source revision**

`51cd59ece1fa` with working tree changes

**Source**

[OfficeDocumentReader.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L49)

**Modifiers**

sealed

Immutable, instance-scoped OfficeIMO document reader suitable for services and concurrent hosts.

## Inheritance

- object
- OfficeDocumentReader

## Remarks

Handler routing is frozen when the reader is built. Other [OfficeDocumentReader](/api/reader/officeimo-reader-officedocumentreader/) instances cannot change this reader's behavior.

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Read documents into normalized content](/docs/reader/) Guide
- [Chunk Documents for Search and AI](/docs/reader/chunking/) Guide
  
  Split documents into bounded, citable chunks with heading paths and page locations for search indexes and retrieval with OfficeIMO.Reader.
- [Extract Tables and Records](/docs/reader/tables-records/) Guide
  
  Extract tables from Word, Excel, PDF and HTML as rows, CSV, Markdown or JSON, and pull key-value records with OfficeIMO.Reader.
- [Reader Quick Start](/docs/reader/quick-start/) Guide
  
  Read Word, PDF, Excel, Markdown, and other documents into Markdown, plain text, or JSON with OfficeIMO.Reader, PSWriteOffice, and the officeimo CLI.
- [Check Supported Formats](/docs/reader/formats/) Guide
  
  List the formats an OfficeIMO.Reader instance can read, detect a file's kind and register every adapter at once from C#, PowerShell or CLI.
- [Read EPUB Files and Extract Chapters](/docs/epub/) Guide
  
  Read EPUB e-books in .NET, get metadata, the table of contents and spine-ordered chapter text, list resources with size limits, and chunk books for search.

## Usage

Explore 2 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 2

- Property [OfficeDocumentReader.Default](/api/reader/officeimo-reader-officedocumentreader/#property-default)
- Method [OfficeDocumentReaderBuilder.Build](/api/reader/officeimo-reader-officedocumentreaderbuilder/#method-build)

Filter members 

Show inherited

## Methods

`public ReaderChunkHierarchyResult ChunkDocument(OfficeDocumentReadResult document, ReaderHierarchicalChunkingOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-chunkdocument-officeimo-reader-officedocumentreadresult-officeimo-reader-readerhierarchicalchunkingoptions-threading-cancellationtoken)

[OfficeDocumentReader.HierarchicalChunking.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.HierarchicalChunking.cs#L9)

Token-chunks an already-read rich document and builds its hierarchy.

Parameters

**document OfficeIMO.Reader.OfficeDocumentReadResult required**

**options OfficeIMO.Reader.ReaderHierarchicalChunkingOptions? = null optional**

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

Returns

`ReaderChunkHierarchyResult`

`public string ClassifyReadError(Exception exception, string? path = null, ReaderOptions? options = null)` [#](#method-classifyreaderror-exception-string-officeimo-reader-readeroptions)

[OfficeDocumentReader.cs:311](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L311)

Maps a read exception to a stable [ReaderErrorCodes](/api/reader/officeimo-reader-readererrorcodes/) value using this reader's handlers, the same classification batch outcomes and folder documents report.

Parameters

**exception System.Exception required**

Exception thrown by a read.

**path string? = null optional**

Optional path of the file that failed. Encrypted Office files report a missing or wrong password as a general load failure; with the path, bounded detection of the file refines that to [ReaderErrorCodes.PasswordRequired](/api/reader/officeimo-reader-readererrorcodes/) or [ReaderErrorCodes.InvalidPassword](/api/reader/officeimo-reader-readererrorcodes/).

**options OfficeIMO.Reader.ReaderOptions? = null optional**

Options used for the failed read, for its [ReaderOptions.OpenPassword](/api/reader/officeimo-reader-readeroptions/) and detection limits.

Returns

`string`

ConvertToMarkdown 3 overloads

`public string ConvertToMarkdown(string path, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-converttomarkdown-string-officeimo-reader-readeroptions-threading-cancellationtoken)

[OfficeDocumentReader.MarkdownConversion.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.MarkdownConversion.cs#L16)

Converts a supported file to its portable Markdown representation.

Parameters

**path string required**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`string` The emitted Markdown, or an empty string when the reader produced no Markdown.

`public string ConvertToMarkdown(Stream stream, string? sourceName = null, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-converttomarkdown-io-stream-string-officeimo-reader-readeroptions-threading-cancellationtoken)

[OfficeDocumentReader.MarkdownConversion.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.MarkdownConversion.cs#L32)

Converts a supported stream to its portable Markdown representation. The caller retains ownership of the stream.

Parameters

**stream System.IO.Stream required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`string` The emitted Markdown, or an empty string when the reader produced no Markdown.

`public string ConvertToMarkdown(byte[] bytes, string? sourceName = null, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-converttomarkdown-byte-string-officeimo-reader-readeroptions-threading-cancellationtoken)

[OfficeDocumentReader.MarkdownConversion.cs:48](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.MarkdownConversion.cs#L48)

Converts supported bytes to their portable Markdown representation.

Parameters

**bytes byte[] required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`string` The emitted Markdown, or an empty string when the reader produced no Markdown.

ConvertToMarkdownAsync 3 overloads

`public async Task<string> ConvertToMarkdownAsync(string path, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-converttomarkdownasync-string-officeimo-reader-readeroptions-threading-cancellationtoken)

Asynchronously converts a supported file to its portable Markdown representation.

Parameters

**path string required**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`Task<string>` The emitted Markdown, or an empty string when the reader produced no Markdown.

`public async Task<string> ConvertToMarkdownAsync(Stream stream, string? sourceName = null, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-converttomarkdownasync-io-stream-string-officeimo-reader-readeroptions-threading-cancellationtoken)

Asynchronously converts a supported stream to its portable Markdown representation. The caller retains ownership of the stream.

Parameters

**stream System.IO.Stream required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`Task<string>` The emitted Markdown, or an empty string when the reader produced no Markdown.

`public async Task<string> ConvertToMarkdownAsync(byte[] bytes, string? sourceName = null, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-converttomarkdownasync-byte-string-officeimo-reader-readeroptions-threading-cancellationtoken)

Asynchronously converts supported bytes to their portable Markdown representation.

Parameters

**bytes byte[] required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`Task<string>` The emitted Markdown, or an empty string when the reader produced no Markdown.

Detect 3 overloads

`public ReaderDetectionResult Detect(string path, ReaderDetectionOptions? options = null)` [#](#method-detect-string-officeimo-reader-readerdetectionoptions)

[OfficeDocumentReader.cs:330](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L330)

Detects a file kind from extension and bounded content evidence using this reader's handlers.

Parameters

**path string required**

**options OfficeIMO.Reader.ReaderDetectionOptions? = null optional**

Returns

`ReaderDetectionResult`

`public ReaderDetectionResult Detect(Stream stream, string? sourceName = null, ReaderDetectionOptions? options = null)` [#](#method-detect-io-stream-string-officeimo-reader-readerdetectionoptions)

[OfficeDocumentReader.cs:342](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L342)

Detects a stream kind from source-name and bounded content evidence using this reader's handlers.

Parameters

**stream System.IO.Stream required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderDetectionOptions? = null optional**

Returns

`ReaderDetectionResult`

`public ReaderDetectionResult Detect(byte[] bytes, string? sourceName = null, ReaderDetectionOptions? options = null)` [#](#method-detect-byte-string-officeimo-reader-readerdetectionoptions)

[OfficeDocumentReader.cs:354](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L354)

Detects a byte payload kind from source-name and bounded content evidence using this reader's handlers.

Parameters

**bytes byte[] required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderDetectionOptions? = null optional**

Returns

`ReaderDetectionResult`

DetectAsync 3 overloads

`public Task<ReaderDetectionResult> DetectAsync(string path, ReaderDetectionOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-detectasync-string-officeimo-reader-readerdetectionoptions-threading-cancellationtoken)

[OfficeDocumentReader.cs:366](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L366)

Asynchronously detects a file kind from extension and bounded content evidence using this reader's handlers.

Parameters

**path string required**

**options OfficeIMO.Reader.ReaderDetectionOptions? = null optional**

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

Returns

`Task<ReaderDetectionResult>`

`public Task<ReaderDetectionResult> DetectAsync(Stream stream, string? sourceName = null, ReaderDetectionOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-detectasync-io-stream-string-officeimo-reader-readerdetectionoptions-threading-cancellationtoken)

[OfficeDocumentReader.cs:377](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L377)

Asynchronously detects a stream kind from source-name and bounded content evidence using this reader's handlers.

Parameters

**stream System.IO.Stream required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderDetectionOptions? = null optional**

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

Returns

`Task<ReaderDetectionResult>`

`public Task<ReaderDetectionResult> DetectAsync(byte[] bytes, string? sourceName = null, ReaderDetectionOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-detectasync-byte-string-officeimo-reader-readerdetectionoptions-threading-cancellationtoken)

[OfficeDocumentReader.cs:390](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L390)

Asynchronously detects a byte payload kind from source-name and bounded content evidence using this reader's handlers.

Parameters

**bytes byte[] required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderDetectionOptions? = null optional**

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

Returns

`Task<ReaderDetectionResult>`

`public ReaderInputKind DetectKind(string path)` [#](#method-detectkind-string)

[OfficeDocumentReader.cs:321](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L321)

Detects a reader input kind using this reader's handler configuration.

Parameters

**path string required**

Returns

`ReaderInputKind`

Enumerate 3 overloads

`public IEnumerable<ReaderChunk> Enumerate(string path, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-enumerate-string-officeimo-reader-readeroptions-threading-cancellationtoken)

[OfficeDocumentReader.Incremental.cs:14](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.Incremental.cs#L14)

Pulls chunks on demand from incremental handlers, with a materialized fallback for other handlers.

Parameters

**path string required**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`IEnumerable<ReaderChunk>`

`public IEnumerable<ReaderChunk> Enumerate(Stream stream, string? sourceName = null, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-enumerate-io-stream-string-officeimo-reader-readeroptions-threading-cancellationtoken)

[OfficeDocumentReader.Incremental.cs:30](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.Incremental.cs#L30)

Pulls chunks from a stable caller-owned stream without a full snapshot when the handler supports it.

Parameters

**stream System.IO.Stream required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`IEnumerable<ReaderChunk>`

`public IEnumerable<ReaderChunk> Enumerate(byte[] bytes, string? sourceName = null, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-enumerate-byte-string-officeimo-reader-readeroptions-threading-cancellationtoken)

[OfficeDocumentReader.Incremental.cs:51](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.Incremental.cs#L51)

Enumerates chunks from caller-owned bytes.

Parameters

**bytes byte[] required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`IEnumerable<ReaderChunk>`

EnumerateAsync 3 overloads

`public IAsyncEnumerable<ReaderChunk> EnumerateAsync(string path, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-enumerateasync-string-officeimo-reader-readeroptions-threading-cancellationtoken)

Pulls chunks asynchronously with backpressure; synchronous handlers execute on a worker.

Parameters

**path string required**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`IAsyncEnumerable<ReaderChunk>`

`public IAsyncEnumerable<ReaderChunk> EnumerateAsync(Stream stream, string? sourceName = null, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-enumerateasync-io-stream-string-officeimo-reader-readeroptions-threading-cancellationtoken)

Pulls caller-owned stream chunks asynchronously with backpressure and early-disposal cleanup.

Parameters

**stream System.IO.Stream required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`IAsyncEnumerable<ReaderChunk>`

`public IAsyncEnumerable<ReaderChunk> EnumerateAsync(byte[] bytes, string? sourceName = null, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-enumerateasync-byte-string-officeimo-reader-readeroptions-threading-cancellationtoken)

Enumerates caller-owned bytes asynchronously with backpressure.

Parameters

**bytes byte[] required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`IAsyncEnumerable<ReaderChunk>`

`public IEnumerable<string> EnumerateDocumentPaths(IEnumerable<string> paths, ReaderFolderOptions? folderOptions = null, CancellationToken cancellationToken = default)` [#](#method-enumeratedocumentpaths-collections-generic-ienumerable-system-string-officeimo-reader-readerfolderoptions-threading-cancellationtoken)

[OfficeDocumentReader.PathEnumeration.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.PathEnumeration.cs#L16)

Expands files and folders using this reader's registered extensions.

Parameters

**paths System.Collections.Generic.IEnumerable<string> required**

**folderOptions OfficeIMO.Reader.ReaderFolderOptions? = null optional**

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

Returns

`IEnumerable<string>`

`public IEnumerable<ReaderChunk> EnumerateFolder(string folderPath, ReaderFolderOptions? folderOptions = null, ReaderOptions? options = null, Action<ReaderProgress>? onProgress = null, CancellationToken cancellationToken = default)` [#](#method-enumeratefolder-string-officeimo-reader-readerfolderoptions-officeimo-reader-readeroptions-action-officeimo-reader-readerprogress-threading-cancellationtoken)

[OfficeDocumentReader.cs:234](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L234)

Enumerates a folder using this reader's registered extensions and handlers.

Parameters

**folderPath string required**

**folderOptions OfficeIMO.Reader.ReaderFolderOptions? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

**onProgress System.Action<OfficeIMO.Reader.ReaderProgress>? = null optional**

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

Returns

`IEnumerable<ReaderChunk>`

`public IEnumerable<ReaderSourceDocument> EnumerateFolderDocuments(string folderPath, ReaderFolderOptions? folderOptions = null, ReaderOptions? options = null, Action<ReaderProgress>? onProgress = null, CancellationToken cancellationToken = default)` [#](#method-enumeratefolderdocuments-string-officeimo-reader-readerfolderoptions-officeimo-reader-readeroptions-action-officeimo-reader-readerprogress-threading-cancellationtoken)

[OfficeDocumentReader.cs:248](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L248)

Enumerates a folder as one source-level payload per file.

Parameters

**folderPath string required**

**folderOptions OfficeIMO.Reader.ReaderFolderOptions? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

**onProgress System.Action<OfficeIMO.Reader.ReaderProgress>? = null optional**

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

Returns

`IEnumerable<ReaderSourceDocument>`

`public IReadOnlyList<ReaderTable> ExtractMarkdownTables(string markdown, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-extractmarkdowntables-string-officeimo-reader-readeroptions-threading-cancellationtoken)

[OfficeDocumentReader.Tables.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.Tables.cs#L9)

Extracts Markdown tables using the configured reader parsing contract.

Parameters

**markdown string required**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`IReadOnlyList<ReaderTable>`

`public IReadOnlyList<ReaderHandlerCapability> GetCapabilities()` [#](#method-getcapabilities)

[OfficeDocumentReader.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L49)

Gets the capabilities configured for this reader.

Returns

`IReadOnlyList<ReaderHandlerCapability>`

`public ReaderCapabilityManifest GetCapabilityManifest()` [#](#method-getcapabilitymanifest)

[OfficeDocumentReader.cs:54](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L54)

Gets a machine-readable capability manifest for this reader.

Returns

`ReaderCapabilityManifest`

`public string GetCapabilityManifestJson(bool indented = false)` [#](#method-getcapabilitymanifestjson-boolean)

[OfficeDocumentReader.cs:59](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L59)

Gets the capability manifest for this reader as JSON.

Parameters

**indented bool = false optional**

Returns

`string`

`public OfficeDocumentProcessingResult ProcessDocument(OfficeDocumentReadResult document, CancellationToken cancellationToken = default)` [#](#method-processdocument-officeimo-reader-officedocumentreadresult-threading-cancellationtoken)

[OfficeDocumentReader.Processors.cs:8](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.Processors.cs#L8)

Processes an already-read document and nested results through this reader's frozen pipeline.

Parameters

**document OfficeIMO.Reader.OfficeDocumentReadResult required**

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

Returns

`OfficeDocumentProcessingResult`

`public async Task<OfficeDocumentProcessingResult> ProcessDocumentAsync(OfficeDocumentReadResult document, CancellationToken cancellationToken = default)` [#](#method-processdocumentasync-officeimo-reader-officedocumentreadresult-threading-cancellationtoken)

Processes an already-read document and nested results asynchronously through this reader's frozen pipeline.

Parameters

**document OfficeIMO.Reader.OfficeDocumentReadResult required**

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

Returns

`Task<OfficeDocumentProcessingResult>`

ReadDocument 3 overloads

`public OfficeDocumentReadResult ReadDocument(string path, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-readdocument-string-officeimo-reader-readeroptions-threading-cancellationtoken)

[OfficeDocumentReader.cs:75](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L75)

Reads a file into the shared rich document envelope.

Parameters

**path string required**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`OfficeDocumentReadResult`

`public OfficeDocumentReadResult ReadDocument(Stream stream, string? sourceName = null, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-readdocument-io-stream-string-officeimo-reader-readeroptions-threading-cancellationtoken)

[OfficeDocumentReader.cs:93](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L93)

Reads a stream into the shared rich document envelope.

Parameters

**stream System.IO.Stream required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`OfficeDocumentReadResult`

`public OfficeDocumentReadResult ReadDocument(byte[] bytes, string? sourceName = null, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-readdocument-byte-string-officeimo-reader-readeroptions-threading-cancellationtoken)

[OfficeDocumentReader.cs:111](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L111)

Reads bytes into the shared rich document envelope.

Parameters

**bytes byte[] required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`OfficeDocumentReadResult`

ReadDocumentAsync 3 overloads

`public Task<OfficeDocumentReadResult> ReadDocumentAsync(string path, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-readdocumentasync-string-officeimo-reader-readeroptions-threading-cancellationtoken)

[OfficeDocumentReader.cs:128](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L128)

Asynchronously reads a file into the shared rich document envelope.

Parameters

**path string required**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`Task<OfficeDocumentReadResult>`

`public Task<OfficeDocumentReadResult> ReadDocumentAsync(Stream stream, string? sourceName = null, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-readdocumentasync-io-stream-string-officeimo-reader-readeroptions-threading-cancellationtoken)

[OfficeDocumentReader.cs:143](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L143)

Asynchronously reads a stream into the shared rich document envelope. The caller retains ownership of the stream.

Parameters

**stream System.IO.Stream required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`Task<OfficeDocumentReadResult>`

`public Task<OfficeDocumentReadResult> ReadDocumentAsync(byte[] bytes, string? sourceName = null, ReaderOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-readdocumentasync-byte-string-officeimo-reader-readeroptions-threading-cancellationtoken)

[OfficeDocumentReader.cs:158](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L158)

Asynchronously reads bytes into the shared rich document envelope.

Parameters

**bytes byte[] required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

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

Returns

`Task<OfficeDocumentReadResult>`

ReadDocumentJson 3 overloads

`public string ReadDocumentJson(string path, ReaderOptions? options = null, bool indented = false, CancellationToken cancellationToken = default)` [#](#method-readdocumentjson-string-officeimo-reader-readeroptions-boolean-threading-cancellationtoken)

[OfficeDocumentReader.cs:194](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L194)

Reads a file into the shared rich document JSON envelope.

Parameters

**path string required**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

**indented bool = false optional**

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

Returns

`string`

`public string ReadDocumentJson(Stream stream, string? sourceName = null, ReaderOptions? options = null, bool indented = false, CancellationToken cancellationToken = default)` [#](#method-readdocumentjson-io-stream-string-officeimo-reader-readeroptions-boolean-threading-cancellationtoken)

[OfficeDocumentReader.cs:206](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L206)

Reads a stream into the shared rich document JSON envelope.

Parameters

**stream System.IO.Stream required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

**indented bool = false optional**

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

Returns

`string`

`public string ReadDocumentJson(byte[] bytes, string? sourceName = null, ReaderOptions? options = null, bool indented = false, CancellationToken cancellationToken = default)` [#](#method-readdocumentjson-byte-string-officeimo-reader-readeroptions-boolean-threading-cancellationtoken)

[OfficeDocumentReader.cs:220](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L220)

Reads bytes into the shared rich document JSON envelope.

Parameters

**bytes byte[] required**

**sourceName string? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

**indented bool = false optional**

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

Returns

`string`

`public async Task ReadDocumentsAsCompletedAsync(IEnumerable<string> paths, Action<ReaderDocumentReadOutcome> onCompleted, ReaderOptions? options = null, ReaderBatchOptions? batchOptions = null, CancellationToken cancellationToken = default)` [#](#member-964d017587fbbaa79a8ded2c)

Asynchronously reads a bounded set of files and reports each resilient outcome without retaining completed document results for the lifetime of the whole batch.

Parameters

**paths System.Collections.Generic.IEnumerable<string> required**

**onCompleted System.Action<OfficeIMO.Reader.ReaderDocumentReadOutcome> required**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

**batchOptions OfficeIMO.Reader.ReaderBatchOptions? = null optional**

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

Returns

`Task`

`public async Task<IReadOnlyList<OfficeDocumentReadResult>> ReadDocumentsAsync(IEnumerable<string> paths, ReaderOptions? options = null, ReaderBatchOptions? batchOptions = null, CancellationToken cancellationToken = default)` [#](#method-readdocumentsasync-collections-generic-ienumerable-system-string-officeimo-reader-readeroptions-officeimo-reader-readerbatchoptions-threading-cancellationtoken)

Asynchronously reads a bounded set of files. Results retain the input path order.

Parameters

**paths System.Collections.Generic.IEnumerable<string> required**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

**batchOptions OfficeIMO.Reader.ReaderBatchOptions? = null optional**

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

Returns

`Task<IReadOnlyList<OfficeDocumentReadResult>>`

`public async Task<IReadOnlyList<ReaderDocumentReadOutcome>> ReadDocumentsDetailedAsync(IEnumerable<string> paths, ReaderOptions? options = null, ReaderBatchOptions? batchOptions = null, Action<ReaderDocumentReadOutcome>? onCompleted = null, CancellationToken cancellationToken = default)` [#](#member-11b076bd128fcf0891f8b8ba)

Asynchronously reads a bounded set of files and captures a success or error outcome for every path.

Parameters

**paths System.Collections.Generic.IEnumerable<string> required**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

**batchOptions OfficeIMO.Reader.ReaderBatchOptions? = null optional**

**onCompleted System.Action<OfficeIMO.Reader.ReaderDocumentReadOutcome>? = null optional**

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

Returns

`Task<IReadOnlyList<ReaderDocumentReadOutcome>>`

`public ReaderIngestResult ReadFolderDetailed(string folderPath, ReaderFolderOptions? folderOptions = null, ReaderOptions? options = null, bool includeChunks = true, Action<ReaderProgress>? onProgress = null, CancellationToken cancellationToken = default)` [#](#method-readfolderdetailed-string-officeimo-reader-readerfolderoptions-officeimo-reader-readeroptions-boolean-action-officeimo-reader-readerprogress-threading-cancellationtoken)

[OfficeDocumentReader.cs:263](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L263)

Reads a folder and returns materialized ingestion details.

Parameters

**folderPath string required**

**folderOptions OfficeIMO.Reader.ReaderFolderOptions? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

**includeChunks bool = true optional**

**onProgress System.Action<OfficeIMO.Reader.ReaderProgress>? = null optional**

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

Returns

`ReaderIngestResult`

ReadHierarchical 3 overloads

`public ReaderChunkHierarchyResult ReadHierarchical(string path, ReaderOptions? readerOptions = null, ReaderHierarchicalChunkingOptions? chunkingOptions = null, CancellationToken cancellationToken = default)` [#](#method-readhierarchical-string-officeimo-reader-readeroptions-officeimo-reader-readerhierarchicalchunkingoptions-threading-cancellationtoken)

[OfficeDocumentReader.HierarchicalChunking.cs:17](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.HierarchicalChunking.cs#L17)

Reads a file through configured processors and returns hierarchical chunks.

Parameters

**path string required**

**readerOptions OfficeIMO.Reader.ReaderOptions? = null optional**

**chunkingOptions OfficeIMO.Reader.ReaderHierarchicalChunkingOptions? = null optional**

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

Returns

`ReaderChunkHierarchyResult`

`public ReaderChunkHierarchyResult ReadHierarchical(Stream stream, string? sourceName = null, ReaderOptions? readerOptions = null, ReaderHierarchicalChunkingOptions? chunkingOptions = null, CancellationToken cancellationToken = default)` [#](#method-readhierarchical-io-stream-string-officeimo-reader-readeroptions-officeimo-reader-readerhierarchicalchunkingoptions-threading-cancellationtoken)

[OfficeDocumentReader.HierarchicalChunking.cs:26](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.HierarchicalChunking.cs#L26)

Reads a stream through configured processors and returns hierarchical chunks.

Parameters

**stream System.IO.Stream required**

**sourceName string? = null optional**

**readerOptions OfficeIMO.Reader.ReaderOptions? = null optional**

**chunkingOptions OfficeIMO.Reader.ReaderHierarchicalChunkingOptions? = null optional**

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

Returns

`ReaderChunkHierarchyResult`

`public ReaderChunkHierarchyResult ReadHierarchical(byte[] bytes, string? sourceName = null, ReaderOptions? readerOptions = null, ReaderHierarchicalChunkingOptions? chunkingOptions = null, CancellationToken cancellationToken = default)` [#](#method-readhierarchical-byte-string-officeimo-reader-readeroptions-officeimo-reader-readerhierarchicalchunkingoptions-threading-cancellationtoken)

[OfficeDocumentReader.HierarchicalChunking.cs:38](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.HierarchicalChunking.cs#L38)

Reads bytes through configured processors and returns hierarchical chunks.

Parameters

**bytes byte[] required**

**sourceName string? = null optional**

**readerOptions OfficeIMO.Reader.ReaderOptions? = null optional**

**chunkingOptions OfficeIMO.Reader.ReaderHierarchicalChunkingOptions? = null optional**

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

Returns

`ReaderChunkHierarchyResult`

ReadHierarchicalAsync 3 overloads

`public async Task<ReaderChunkHierarchyResult> ReadHierarchicalAsync(string path, ReaderOptions? readerOptions = null, ReaderHierarchicalChunkingOptions? chunkingOptions = null, CancellationToken cancellationToken = default)` [#](#method-readhierarchicalasync-string-officeimo-reader-readeroptions-officeimo-reader-readerhierarchicalchunkingoptions-threading-cancellationtoken)

Asynchronously reads a file through configured processors and returns hierarchical chunks.

Parameters

**path string required**

**readerOptions OfficeIMO.Reader.ReaderOptions? = null optional**

**chunkingOptions OfficeIMO.Reader.ReaderHierarchicalChunkingOptions? = null optional**

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

Returns

`Task<ReaderChunkHierarchyResult>`

`public async Task<ReaderChunkHierarchyResult> ReadHierarchicalAsync(Stream stream, string? sourceName = null, ReaderOptions? readerOptions = null, ReaderHierarchicalChunkingOptions? chunkingOptions = null, CancellationToken cancellationToken = default)` [#](#method-readhierarchicalasync-io-stream-string-officeimo-reader-readeroptions-officeimo-reader-readerhierarchicalchunkingoptions-threading-cancellationtoken)

Asynchronously reads a stream through configured processors and returns hierarchical chunks.

Parameters

**stream System.IO.Stream required**

**sourceName string? = null optional**

**readerOptions OfficeIMO.Reader.ReaderOptions? = null optional**

**chunkingOptions OfficeIMO.Reader.ReaderHierarchicalChunkingOptions? = null optional**

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

Returns

`Task<ReaderChunkHierarchyResult>`

`public async Task<ReaderChunkHierarchyResult> ReadHierarchicalAsync(byte[] bytes, string? sourceName = null, ReaderOptions? readerOptions = null, ReaderHierarchicalChunkingOptions? chunkingOptions = null, CancellationToken cancellationToken = default)` [#](#method-readhierarchicalasync-byte-string-officeimo-reader-readeroptions-officeimo-reader-readerhierarchicalchunkingoptions-threading-cancellationtoken)

Asynchronously reads bytes through configured processors and returns hierarchical chunks.

Parameters

**bytes byte[] required**

**sourceName string? = null optional**

**readerOptions OfficeIMO.Reader.ReaderOptions? = null optional**

**chunkingOptions OfficeIMO.Reader.ReaderHierarchicalChunkingOptions? = null optional**

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

Returns

`Task<ReaderChunkHierarchyResult>`

`public ReaderPathDocumentResult ReadPathDocumentsDetailed(string path, ReaderFolderOptions? folderOptions = null, ReaderOptions? options = null, bool includeDocumentChunks = true, int? maxReturnedChunks = null, Action<ReaderProgress>? onProgress = null, CancellationToken cancellationToken = default)` [#](#member-efa1c198cbd4cd6e6b1a7e69)

[OfficeDocumentReader.cs:282](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L282)

Reads a file or folder and returns source-level document payloads with optional chunk shaping.

Parameters

**path string required**

**folderOptions OfficeIMO.Reader.ReaderFolderOptions? = null optional**

**options OfficeIMO.Reader.ReaderOptions? = null optional**

**includeDocumentChunks bool = true optional**

**maxReturnedChunks int? = null optional**

**onProgress System.Action<OfficeIMO.Reader.ReaderProgress>? = null optional**

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

Returns

`ReaderPathDocumentResult`

## 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 static OfficeDocumentReader Default { get; }` [#](#property-default)

[OfficeDocumentReader.cs:34](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L34)

Gets an immutable reader with no configured format handlers.

`public int MaxConcurrentReads { get; }` [#](#property-maxconcurrentreads)

[OfficeDocumentReader.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L39)

Gets the maximum number of asynchronous operations allowed in flight for this reader.

`public OfficeDocumentProcessorPipeline ProcessorPipeline { get; }` [#](#property-processorpipeline)

[OfficeDocumentReader.cs:42](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L42)

Gets this reader's immutable ordered processor pipeline.

`public OfficeDocumentProcessorFailureBehavior ProcessorFailureBehavior { get; }` [#](#property-processorfailurebehavior)

[OfficeDocumentReader.cs:45](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.cs#L45)

Gets the configured processor failure behavior.

`public ReaderOptions DefaultOptions { get; }` [#](#property-defaultoptions)

[OfficeDocumentReader.DefaultOptions.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/51cd59ece1fa22f062b7419cfd3afa43c266a7cf/OfficeIMO.Reader.Core/OfficeDocumentReader.DefaultOptions.cs#L10)

Returns an independent copy of this reader's default read and folder policies.

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