Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

ReaderOptions

OfficeIMO.Reader

Namespace
OfficeIMO.Reader
Assembly
OfficeIMO.Reader.Core
Source revision
0eef6a5756b9 with working tree changes
Modifiers
sealed

Options controlling extraction behavior for OfficeDocumentReader.

Inheritance

  • object
  • ReaderOptions

Usage

Explore 31 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.

Accepted by parameters 20

Constructors

public ReaderOptions() #

Methods

public static ReaderOptions CreateSafeIngestion() #

Creates explicit bounded ingestion defaults: 64 MiB input, 50,000 chunks, 32 Mi characters, 100,000 blocks, 512 assets/128 MiB asset payload, and 2,000 nested inputs/256 MiB at depth 8. Format-specific security limits continue to apply. Tune these budgets to the host workload.

Properties

public ReaderFolderOptions? FolderOptions { get; set; } #

Optional defaults for file and folder selection. Explicit folder options replace this policy.

public ReaderProjection Projection { get; set; } #

Requested derived representations. Unsupported handlers reject TextAndMetadata and Text before parsing. The ordinary rich projection is the default.

public ReaderResourceLimits? ResourceLimits { get; set; } #

Optional aggregate resource budgets for a read, including nested inputs.

public ReaderInspectionOptions? Inspection { get; set; } #

Opt-in native review, formula, visibility and inert package evidence. Null retains ordinary extraction.

public long? MaxInputBytes { get; set; } #

Optional maximum input size in bytes enforced by OfficeDocumentReader when reading from a file or seekable stream. When null, a registered format handler may apply its documented default; otherwise no size limit is enforced.

public Encoding? TextEncoding { get; set; } #

Default encoding for plain-text input without a Unicode byte-order mark. Null selects UTF-8. A BOM takes precedence. Encoding settings are snapshotted per read.

public bool ThrowOnInvalidTextBytes { get; set; } #

Reject invalid byte sequences in plain-text input. When false, replace them with U+FFFD and emit a source decoding warning. Default: false.

public long? OpenXmlMaxCharactersInPart { get; set; } #

OpenXML security: maximum characters allowed per part when opening OpenXML packages (best-effort). When null, the OpenXML SDK default is used.

public long? OpenXmlMaxPartUncompressedBytes { get; set; } #

Optional admission ceiling for one uncompressed part in Word, Excel and PowerPoint package loading. The native policy applies to ZIP parts and compound streams, including encrypted envelopes. Null retains the owner's default policy. This is distinct from compressed input and output character limits.

public long? OpenXmlMaxTotalUncompressedBytes { get; set; } #

Optional admission ceiling for aggregate uncompressed part sizes in Word, Excel and PowerPoint packages. Native package declarations are checked before model construction; this is not a hard process-memory or total repeated decoding-work guarantee. Null retains the owner's default policy.

public int? MaxOpenXmlImageAssets { get; set; } #

OpenXML security: maximum image asset entries emitted from an Office package. When null, no image asset entry limit is enforced.

public string? OpenPassword { get; set; } #

Optional password used to open encrypted Office files when the selected reader engine supports decryption.

public int? MaxOpenXmlImagePlacementsPerRelationship { get; set; } #

OpenXML security: maximum placements emitted for one image relationship. When null, no per-relationship placement limit is enforced.

public long? MaxOpenXmlImageAssetBytes { get; set; } #

OpenXML security: maximum bytes read from a single image part. When null, no individual image payload limit is enforced.

public long? MaxOpenXmlImageTotalAssetBytes { get; set; } #

OpenXML security: maximum unique image payload bytes retained while extracting assets. Repeated placements of the same image part count once toward this limit. When null, no total image payload limit is enforced.

public int MaxChars { get; set; } #

Maximum characters per emitted chunk (best-effort).

public int MaxTableRows { get; set; } #

Maximum number of table rows included per table chunk (best-effort).

public bool ComputeHashes { get; set; } #

When true, computes source/chunk hashes for incremental indexing workflows. Default: true.

public ReaderDetectionMode DetectionMode { get; set; } #

Controls extension/content detection during reads. The default inspects content only when the extension is unknown.

public int DetectionMaxProbeBytes { get; set; } #

Maximum prefix bytes inspected when content detection runs. Default: 64 KiB.

public int DetectionMaxContainerEntries { get; set; } #

Maximum ZIP entries inspected when classifying Office, Visio, EPUB, and ZIP containers. Default: 512.

public bool DetectionInspectContainers { get; set; } #

Inspect container structure when classifying content during reads. Default: true.