# Reader, Document Extraction, and OCR

Detect formats and extract normalized documents, chunks, hierarchy, tables, visuals, assets, OCR text, and ingest results. Includes examples and cmdlet links.

Reader is the cross-format path for search, review, ingestion, migration, OCR, and AI preparation. Its 7 exported commands expose the normalized OfficeIMO.Reader model and the easy local image OCR entry point without forcing the caller to switch on every native document type. `Get-OfficeDocumentInfo` and `Get-OfficeDocumentCapability` are listed with the cross-format operations, but they belong to the same workflow.

## What Reader returns

- `Read-OfficeDocument` returns the normalized document envelope.
- `Get-OfficeDocumentInfo` (cross-format operations) reports detected format and routing evidence.
- `Get-OfficeDocumentCapability` (cross-format operations) explains the registered adapters' supported output.
- `Read-OfficeDocument -As Hierarchy` exposes section and structural relationships.
- `-As Chunks` returns bounded text/content chunks; `-As Structure` exposes structured content.
- `-As Tables`, `-As Visuals`, and `-As Assets` return non-text material explicitly.
- `Read-OfficeDocument -Path .\Knowledge -Recurse -As Ingest` returns a corpus ingestion summary.
- `Search-OfficeDocument` searches the normalized result.
- `Read-OfficeDocument -Path .\scan.png -As Text -Ocr` performs local image OCR; OCR settings come from `New-OfficeOcrOptions`.

## Choose Reader versus a native family

Use Reader when downstream behavior is common across file formats: indexing, chunking, extraction, discovery, classification, previews, and bulk ingest. Use Word, Excel, PowerPoint, PDF, Visio, or another native family when the script must modify format-specific objects and preserve their native semantics.

Reader adapters are modular. A deployment can carry only the adapters it needs, while broader presets compose multiple local formats. Optional OCR, web, and process-backed integrations have separate dependency and trust boundaries.

## Task guides

- [Search across Office and document files](/docs/pswriteoffice/reader-search-corpus/)
- [Extract chunks, tables, and assets](/docs/pswriteoffice/reader-chunks-tables/)
- [Build bounded ingestion pipelines](/docs/pswriteoffice/reader-ingest-pipelines/)

## Operational pattern

Detect first, inspect capabilities, extract the required surfaces, and record warnings/provenance with the output. Do not silently reduce a document to plain text when tables, visuals, or assets matter to the consumer.

See the [document Reader examples](https://github.com/EvotecIT/OfficeIMO/tree/105ae88c45f6be3bb2020384e25ffe61d990451b/PowerShell/PSWriteOffice/Examples/Reader) and search the [command reference](/api/powershell/) for `OfficeDocument`.

<!-- PowerForge markdown source sha256:C674FB1825E3738716412EF5B65FF21DE195AF43A9613A552C142E1A273AE45C; title=True -->

<!-- PowerForge markdown artifact sha256:4DB2DDBD6EB7A0C3071FA263EA0C5D7756B5DCBAAF82150FD8792E423A39CF2F -->
