API Reference
OfficeDocumentReader
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. Static DocumentReader registrations and other OfficeDocumentReader instances cannot change this reader's behavior.
Usage
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by
- Property OfficeDocumentReader.Default
- Method OfficeDocumentReaderBuilder.Build
Methods
public ReaderChunkHierarchyResult ChunkDocument(OfficeDocumentReadResult document, ReaderHierarchicalChunkingOptions options = null, CancellationToken cancellationToken = null) #ReaderChunkHierarchyResultToken-chunks an already-read rich document and builds its hierarchy.
Parameters
- document OfficeIMO.Reader.OfficeDocumentReadResult
- options OfficeIMO.Reader.ReaderHierarchicalChunkingOptions = null
- cancellationToken System.Threading.CancellationToken = null
public ReaderDetectionResult Detect(String path, ReaderDetectionOptions options = null) #ReaderDetectionResultDetects a file kind from extension and bounded content evidence using this reader's handlers.
Parameters
- path System.String
- options OfficeIMO.Reader.ReaderDetectionOptions = null
public ReaderDetectionResult Detect(Byte[] bytes, String sourceName = null, ReaderDetectionOptions options = null) #ReaderDetectionResultDetects a stream kind from source-name and bounded content evidence using this reader's handlers.
Parameters
- stream System.IO.Stream
- sourceName System.String = null
- options OfficeIMO.Reader.ReaderDetectionOptions = null
Detect(System.Byte[] bytes, System.String sourceName, OfficeIMO.Reader.ReaderDetectionOptions options) #Detects a byte payload kind from source-name and bounded content evidence using this reader's handlers.
Parameters
- bytes System.Byte[]
- sourceName System.String
- options OfficeIMO.Reader.ReaderDetectionOptions
public Task<ReaderDetectionResult> DetectAsync(String path, ReaderDetectionOptions options = null, CancellationToken cancellationToken = null) #Task<ReaderDetectionResult>Asynchronously detects a file kind from extension and bounded content evidence using this reader's handlers.
Parameters
- path System.String
- options OfficeIMO.Reader.ReaderDetectionOptions = null
- cancellationToken System.Threading.CancellationToken = null
public Task<ReaderDetectionResult> DetectAsync(Byte[] bytes, String sourceName = null, ReaderDetectionOptions options = null, CancellationToken cancellationToken = null) #Task<ReaderDetectionResult>Asynchronously detects a stream kind from source-name and bounded content evidence using this reader's handlers.
Parameters
- stream System.IO.Stream
- sourceName System.String = null
- options OfficeIMO.Reader.ReaderDetectionOptions = null
- cancellationToken System.Threading.CancellationToken = null
DetectAsync(System.Byte[] bytes, System.String sourceName, OfficeIMO.Reader.ReaderDetectionOptions options, System.Threading.CancellationToken cancellationToken) #Asynchronously detects a byte payload kind from source-name and bounded content evidence using this reader's handlers.
Parameters
- bytes System.Byte[]
- sourceName System.String
- options OfficeIMO.Reader.ReaderDetectionOptions
- cancellationToken System.Threading.CancellationToken
public ReaderInputKind DetectKind(String path) #ReaderInputKindDetects a reader input kind using this reader's handler configuration.
Parameters
- path System.String
public OfficeDocumentStructuredExtractionResult ExtractStructured(OfficeDocumentReadResult document, OfficeDocumentStructuredExtractionOptions options = null, CancellationToken cancellationToken = null) #OfficeDocumentStructuredExtractionResultExtracts a bounded structured view from an already-read document.
Parameters
- document OfficeIMO.Reader.OfficeDocumentReadResult
- options OfficeIMO.Reader.OfficeDocumentStructuredExtractionOptions = null
- cancellationToken System.Threading.CancellationToken = null
public IReadOnlyList<ReaderHandlerCapability> GetCapabilities(Boolean includeBuiltIn = true, Boolean includeCustom = true) #IReadOnlyList<ReaderHandlerCapability>Lists capabilities visible to this reader instance.
Parameters
- includeBuiltIn System.Boolean = true
- includeCustom System.Boolean = true
public ReaderCapabilityManifest GetCapabilityManifest(Boolean includeBuiltIn = true, Boolean includeCustom = true) #ReaderCapabilityManifestBuilds a capability manifest for this reader instance.
Parameters
- includeBuiltIn System.Boolean = true
- includeCustom System.Boolean = true
public String GetCapabilityManifestJson(Boolean includeBuiltIn = true, Boolean includeCustom = true, Boolean indented = false) #StringBuilds a JSON capability manifest for this reader instance.
Parameters
- includeBuiltIn System.Boolean = true
- includeCustom System.Boolean = true
- indented System.Boolean = false
public OfficeDocumentProcessingResult ProcessDocument(OfficeDocumentReadResult document, CancellationToken cancellationToken = null) #OfficeDocumentProcessingResultProcesses an already-read document through this reader's frozen pipeline.
Parameters
- document OfficeIMO.Reader.OfficeDocumentReadResult
- cancellationToken System.Threading.CancellationToken = null
public Task<OfficeDocumentProcessingResult> ProcessDocumentAsync(OfficeDocumentReadResult document, CancellationToken cancellationToken = null) #Task<OfficeDocumentProcessingResult>Processes an already-read document asynchronously through this reader's frozen pipeline.
Parameters
- document OfficeIMO.Reader.OfficeDocumentReadResult
- cancellationToken System.Threading.CancellationToken = null
public IEnumerable<ReaderChunk> Read(String path, ReaderOptions options = null, CancellationToken cancellationToken = null) #IEnumerable<ReaderChunk>Reads a supported file using this reader's frozen handler configuration.
Parameters
- path System.String
- options OfficeIMO.Reader.ReaderOptions = null
- cancellationToken System.Threading.CancellationToken = null
public IEnumerable<ReaderChunk> Read(Byte[] bytes, String sourceName = null, ReaderOptions options = null, CancellationToken cancellationToken = null) #IEnumerable<ReaderChunk>Reads a supported stream using this reader's frozen handler configuration.
Parameters
- stream System.IO.Stream
- sourceName System.String = null
- options OfficeIMO.Reader.ReaderOptions = null
- cancellationToken System.Threading.CancellationToken = null
Read(System.Byte[] bytes, System.String sourceName, OfficeIMO.Reader.ReaderOptions options, System.Threading.CancellationToken cancellationToken) #Reads supported bytes using this reader's frozen handler configuration.
Parameters
- bytes System.Byte[]
- sourceName System.String
- options OfficeIMO.Reader.ReaderOptions
- cancellationToken System.Threading.CancellationToken
public Task<IReadOnlyList<ReaderChunk>> ReadAsync(String path, ReaderOptions options = null, CancellationToken cancellationToken = null) #Task<IReadOnlyList<ReaderChunk>>Asynchronously reads a file into normalized chunks.
Parameters
- path System.String
- options OfficeIMO.Reader.ReaderOptions = null
- cancellationToken System.Threading.CancellationToken = null
public Task<IReadOnlyList<ReaderChunk>> ReadAsync(Byte[] bytes, String sourceName = null, ReaderOptions options = null, CancellationToken cancellationToken = null) #Task<IReadOnlyList<ReaderChunk>>Asynchronously reads a stream into normalized chunks. The caller retains ownership of the stream.
Parameters
- stream System.IO.Stream
- sourceName System.String = null
- options OfficeIMO.Reader.ReaderOptions = null
- cancellationToken System.Threading.CancellationToken = null
ReadAsync(System.Byte[] bytes, System.String sourceName, OfficeIMO.Reader.ReaderOptions options, System.Threading.CancellationToken cancellationToken) #Asynchronously reads bytes into normalized chunks.
Parameters
- bytes System.Byte[]
- sourceName System.String
- options OfficeIMO.Reader.ReaderOptions
- cancellationToken System.Threading.CancellationToken
public OfficeDocumentReadResult ReadDocument(String path, ReaderOptions options = null, CancellationToken cancellationToken = null) #OfficeDocumentReadResultReads a file into the shared rich document envelope.
Parameters
- path System.String
- options OfficeIMO.Reader.ReaderOptions = null
- cancellationToken System.Threading.CancellationToken = null
public OfficeDocumentReadResult ReadDocument(Byte[] bytes, String sourceName = null, ReaderOptions options = null, CancellationToken cancellationToken = null) #OfficeDocumentReadResultReads a stream into the shared rich document envelope.
Parameters
- stream System.IO.Stream
- sourceName System.String = null
- options OfficeIMO.Reader.ReaderOptions = null
- cancellationToken System.Threading.CancellationToken = null
ReadDocument(System.Byte[] bytes, System.String sourceName, OfficeIMO.Reader.ReaderOptions options, System.Threading.CancellationToken cancellationToken) #Reads bytes into the shared rich document envelope.
Parameters
- bytes System.Byte[]
- sourceName System.String
- options OfficeIMO.Reader.ReaderOptions
- cancellationToken System.Threading.CancellationToken
public Task<OfficeDocumentReadResult> ReadDocumentAsync(String path, ReaderOptions options = null, CancellationToken cancellationToken = null) #Task<OfficeDocumentReadResult>Asynchronously reads a file into the shared rich document envelope.
Parameters
- path System.String
- options OfficeIMO.Reader.ReaderOptions = null
- cancellationToken System.Threading.CancellationToken = null
public Task<OfficeDocumentReadResult> ReadDocumentAsync(Byte[] bytes, String sourceName = null, ReaderOptions options = null, CancellationToken cancellationToken = null) #Task<OfficeDocumentReadResult>Asynchronously reads a stream into the shared rich document envelope. The caller retains ownership of the stream.
Parameters
- stream System.IO.Stream
- sourceName System.String = null
- options OfficeIMO.Reader.ReaderOptions = null
- cancellationToken System.Threading.CancellationToken = null
ReadDocumentAsync(System.Byte[] bytes, System.String sourceName, OfficeIMO.Reader.ReaderOptions options, System.Threading.CancellationToken cancellationToken) #Asynchronously reads bytes into the shared rich document envelope.
Parameters
- bytes System.Byte[]
- sourceName System.String
- options OfficeIMO.Reader.ReaderOptions
- cancellationToken System.Threading.CancellationToken
public String ReadDocumentJson(String path, ReaderOptions options = null, Boolean indented = false, CancellationToken cancellationToken = null) #StringReads a file into the shared rich document JSON envelope.
Parameters
- path System.String
- options OfficeIMO.Reader.ReaderOptions = null
- indented System.Boolean = false
- cancellationToken System.Threading.CancellationToken = null
public String ReadDocumentJson(Byte[] bytes, String sourceName = null, ReaderOptions options = null, Boolean indented = false, CancellationToken cancellationToken = null) #StringReads a stream into the shared rich document JSON envelope.
Parameters
- stream System.IO.Stream
- sourceName System.String = null
- options OfficeIMO.Reader.ReaderOptions = null
- indented System.Boolean = false
- cancellationToken System.Threading.CancellationToken = null
ReadDocumentJson(System.Byte[] bytes, System.String sourceName, OfficeIMO.Reader.ReaderOptions options, System.Boolean indented, System.Threading.CancellationToken cancellationToken) #Reads bytes into the shared rich document JSON envelope.
Parameters
- bytes System.Byte[]
- sourceName System.String
- options OfficeIMO.Reader.ReaderOptions
- indented System.Boolean
- cancellationToken System.Threading.CancellationToken
public Task<IReadOnlyList<OfficeDocumentReadResult>> ReadDocumentsAsync(IEnumerable<String> paths, ReaderOptions options = null, ReaderBatchOptions batchOptions = null, CancellationToken cancellationToken = null) #Task<IReadOnlyList<OfficeDocumentReadResult>>Asynchronously reads a bounded set of files. Results retain the input path order.
Parameters
- paths System.Collections.Generic.IEnumerable{System.String}
- options OfficeIMO.Reader.ReaderOptions = null
- batchOptions OfficeIMO.Reader.ReaderBatchOptions = null
- cancellationToken System.Threading.CancellationToken = null
public IEnumerable<ReaderChunk> ReadFolder(String folderPath, ReaderFolderOptions folderOptions = null, ReaderOptions options = null, Action<ReaderProgress> onProgress = null, CancellationToken cancellationToken = null) #IEnumerable<ReaderChunk>Enumerates a folder using this reader's registered extensions and handlers.
Parameters
- folderPath System.String
- folderOptions OfficeIMO.Reader.ReaderFolderOptions = null
- options OfficeIMO.Reader.ReaderOptions = null
- onProgress System.Action{OfficeIMO.Reader.ReaderProgress} = null
- cancellationToken System.Threading.CancellationToken = null
public ReaderIngestResult ReadFolderDetailed(String folderPath, ReaderFolderOptions folderOptions = null, ReaderOptions options = null, Boolean includeChunks = true, Action<ReaderProgress> onProgress = null, CancellationToken cancellationToken = null) #ReaderIngestResultReads a folder and returns materialized ingestion details.
Parameters
- folderPath System.String
- folderOptions OfficeIMO.Reader.ReaderFolderOptions = null
- options OfficeIMO.Reader.ReaderOptions = null
- includeChunks System.Boolean = true
- onProgress System.Action{OfficeIMO.Reader.ReaderProgress} = null
- cancellationToken System.Threading.CancellationToken = null
public IEnumerable<ReaderSourceDocument> ReadFolderDocuments(String folderPath, ReaderFolderOptions folderOptions = null, ReaderOptions options = null, Action<ReaderProgress> onProgress = null, CancellationToken cancellationToken = null) #IEnumerable<ReaderSourceDocument>Enumerates a folder as one source-level payload per file.
Parameters
- folderPath System.String
- folderOptions OfficeIMO.Reader.ReaderFolderOptions = null
- options OfficeIMO.Reader.ReaderOptions = null
- onProgress System.Action{OfficeIMO.Reader.ReaderProgress} = null
- cancellationToken System.Threading.CancellationToken = null
public ReaderChunkHierarchyResult ReadHierarchical(String path, ReaderOptions readerOptions = null, ReaderHierarchicalChunkingOptions chunkingOptions = null, CancellationToken cancellationToken = null) #ReaderChunkHierarchyResultReads a file through configured processors and returns hierarchical chunks.
Parameters
- path System.String
- readerOptions OfficeIMO.Reader.ReaderOptions = null
- chunkingOptions OfficeIMO.Reader.ReaderHierarchicalChunkingOptions = null
- cancellationToken System.Threading.CancellationToken = null
public ReaderChunkHierarchyResult ReadHierarchical(Byte[] bytes, String sourceName = null, ReaderOptions readerOptions = null, ReaderHierarchicalChunkingOptions chunkingOptions = null, CancellationToken cancellationToken = null) #ReaderChunkHierarchyResultReads a stream through configured processors and returns hierarchical chunks.
Parameters
- stream System.IO.Stream
- sourceName System.String = null
- readerOptions OfficeIMO.Reader.ReaderOptions = null
- chunkingOptions OfficeIMO.Reader.ReaderHierarchicalChunkingOptions = null
- cancellationToken System.Threading.CancellationToken = null
ReadHierarchical(System.Byte[] bytes, System.String sourceName, OfficeIMO.Reader.ReaderOptions readerOptions, OfficeIMO.Reader.ReaderHierarchicalChunkingOptions chunkingOptions, System.Threading.CancellationToken cancellationToken) #Reads bytes through configured processors and returns hierarchical chunks.
Parameters
- bytes System.Byte[]
- sourceName System.String
- readerOptions OfficeIMO.Reader.ReaderOptions
- chunkingOptions OfficeIMO.Reader.ReaderHierarchicalChunkingOptions
- cancellationToken System.Threading.CancellationToken
public async Task<ReaderChunkHierarchyResult> ReadHierarchicalAsync(String path, ReaderOptions readerOptions = null, ReaderHierarchicalChunkingOptions chunkingOptions = null, CancellationToken cancellationToken = null) #Task<ReaderChunkHierarchyResult>Asynchronously reads a file through configured processors and returns hierarchical chunks.
Parameters
- path System.String
- readerOptions OfficeIMO.Reader.ReaderOptions = null
- chunkingOptions OfficeIMO.Reader.ReaderHierarchicalChunkingOptions = null
- cancellationToken System.Threading.CancellationToken = null
public async Task<ReaderChunkHierarchyResult> ReadHierarchicalAsync(Byte[] bytes, String sourceName = null, ReaderOptions readerOptions = null, ReaderHierarchicalChunkingOptions chunkingOptions = null, CancellationToken cancellationToken = null) #Task<ReaderChunkHierarchyResult>Asynchronously reads a stream through configured processors and returns hierarchical chunks.
Parameters
- stream System.IO.Stream
- sourceName System.String = null
- readerOptions OfficeIMO.Reader.ReaderOptions = null
- chunkingOptions OfficeIMO.Reader.ReaderHierarchicalChunkingOptions = null
- cancellationToken System.Threading.CancellationToken = null
ReadHierarchicalAsync(System.Byte[] bytes, System.String sourceName, OfficeIMO.Reader.ReaderOptions readerOptions, OfficeIMO.Reader.ReaderHierarchicalChunkingOptions chunkingOptions, System.Threading.CancellationToken cancellationToken) #Asynchronously reads bytes through configured processors and returns hierarchical chunks.
Parameters
- bytes System.Byte[]
- sourceName System.String
- readerOptions OfficeIMO.Reader.ReaderOptions
- chunkingOptions OfficeIMO.Reader.ReaderHierarchicalChunkingOptions
- cancellationToken System.Threading.CancellationToken
public ReaderPathDocumentResult ReadPathDocumentsDetailed(String path, ReaderFolderOptions folderOptions = null, ReaderOptions options = null, Boolean includeDocumentChunks = true, Nullable<Int32> maxReturnedChunks = null, Action<ReaderProgress> onProgress = null, CancellationToken cancellationToken = null) #ReaderPathDocumentResultReads a file or folder and returns source-level document payloads with optional chunk shaping.
Parameters
- path System.String
- folderOptions OfficeIMO.Reader.ReaderFolderOptions = null
- options OfficeIMO.Reader.ReaderOptions = null
- includeDocumentChunks System.Boolean = true
- maxReturnedChunks System.Nullable{System.Int32} = null
- onProgress System.Action{OfficeIMO.Reader.ReaderProgress} = null
- cancellationToken System.Threading.CancellationToken = null
public OfficeDocumentStructuredExtractionResult ReadStructured(String path, ReaderOptions readerOptions = null, OfficeDocumentStructuredExtractionOptions structuredOptions = null, CancellationToken cancellationToken = null) #OfficeDocumentStructuredExtractionResultReads a file through this reader's processors and extracts a bounded structured view.
Parameters
- path System.String
- readerOptions OfficeIMO.Reader.ReaderOptions = null
- structuredOptions OfficeIMO.Reader.OfficeDocumentStructuredExtractionOptions = null
- cancellationToken System.Threading.CancellationToken = null
public OfficeDocumentStructuredExtractionResult ReadStructured(Byte[] bytes, String sourceName = null, ReaderOptions readerOptions = null, OfficeDocumentStructuredExtractionOptions structuredOptions = null, CancellationToken cancellationToken = null) #OfficeDocumentStructuredExtractionResultReads a stream through this reader's processors and extracts a bounded structured view.
Parameters
- stream System.IO.Stream
- sourceName System.String = null
- readerOptions OfficeIMO.Reader.ReaderOptions = null
- structuredOptions OfficeIMO.Reader.OfficeDocumentStructuredExtractionOptions = null
- cancellationToken System.Threading.CancellationToken = null
ReadStructured(System.Byte[] bytes, System.String sourceName, OfficeIMO.Reader.ReaderOptions readerOptions, OfficeIMO.Reader.OfficeDocumentStructuredExtractionOptions structuredOptions, System.Threading.CancellationToken cancellationToken) #Reads bytes through this reader's processors and extracts a bounded structured view.
Parameters
- bytes System.Byte[]
- sourceName System.String
- readerOptions OfficeIMO.Reader.ReaderOptions
- structuredOptions OfficeIMO.Reader.OfficeDocumentStructuredExtractionOptions
- cancellationToken System.Threading.CancellationToken
public async Task<OfficeDocumentStructuredExtractionResult> ReadStructuredAsync(String path, ReaderOptions readerOptions = null, OfficeDocumentStructuredExtractionOptions structuredOptions = null, CancellationToken cancellationToken = null) #Task<OfficeDocumentStructuredExtractionResult>Asynchronously reads a file through this reader's processors and extracts a bounded structured view.
Parameters
- path System.String
- readerOptions OfficeIMO.Reader.ReaderOptions = null
- structuredOptions OfficeIMO.Reader.OfficeDocumentStructuredExtractionOptions = null
- cancellationToken System.Threading.CancellationToken = null
public async Task<OfficeDocumentStructuredExtractionResult> ReadStructuredAsync(Byte[] bytes, String sourceName = null, ReaderOptions readerOptions = null, OfficeDocumentStructuredExtractionOptions structuredOptions = null, CancellationToken cancellationToken = null) #Task<OfficeDocumentStructuredExtractionResult>Asynchronously reads a stream through this reader's processors and extracts a bounded structured view.
Parameters
- stream System.IO.Stream
- sourceName System.String = null
- readerOptions OfficeIMO.Reader.ReaderOptions = null
- structuredOptions OfficeIMO.Reader.OfficeDocumentStructuredExtractionOptions = null
- cancellationToken System.Threading.CancellationToken = null
ReadStructuredAsync(System.Byte[] bytes, System.String sourceName, OfficeIMO.Reader.ReaderOptions readerOptions, OfficeIMO.Reader.OfficeDocumentStructuredExtractionOptions structuredOptions, System.Threading.CancellationToken cancellationToken) #Asynchronously reads bytes through this reader's processors and extracts a bounded structured view.
Parameters
- bytes System.Byte[]
- sourceName System.String
- readerOptions OfficeIMO.Reader.ReaderOptions
- structuredOptions OfficeIMO.Reader.OfficeDocumentStructuredExtractionOptions
- cancellationToken System.Threading.CancellationToken
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public static OfficeDocumentReader Default { get; } #Gets a reader with built-in handlers and no custom registrations.
public Int32 MaxConcurrentReads { get; } #Gets the maximum number of asynchronous operations allowed in flight for this reader.
public OfficeDocumentProcessorPipeline ProcessorPipeline { get; } #Gets this reader's immutable ordered processor pipeline.
public OfficeDocumentProcessorFailureBehavior ProcessorFailureBehavior { get; } #Gets the configured processor failure behavior.