# RtfReadResult

Result of reading RTF into syntax and semantic models.

Class 

`OfficeIMO.Rtf`

**Namespace**

`OfficeIMO.Rtf`

**Assembly**

`OfficeIMO.Rtf`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[RtfReadResult.cs:28](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.cs#L28)

**Implements**

`IOfficeResult<RtfDocument>` `IOfficeResult`

**Modifiers**

sealed

Result of reading RTF into syntax and semantic models.

## Inheritance

- object
- RtfReadResult

## Usage

Explore 5 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 4

- Method [RtfDocument.LoadResult](/api/rtf/officeimo-rtf-rtfdocument/#method-loadresult-string-officeimo-rtf-rtfloadoptions-text-encoding-threading-cancellationtoken)
- Method [RtfDocument.LoadResultAsync](/api/rtf/officeimo-rtf-rtfdocument/#method-loadresultasync-string-officeimo-rtf-rtfloadoptions-text-encoding-threading-cancellationtoken)
- Method [RtfDocument.ParseResult](/api/rtf/officeimo-rtf-rtfdocument/#method-parseresult-string-officeimo-rtf-rtfloadoptions-threading-cancellationtoken)
- Method [RtfLosslessEditor.ToReadResult](/api/rtf/officeimo-rtf-rtflosslesseditor/#method-toreadresult-officeimo-rtf-rtfloadoptions)

### Accepted by parameters 1

- Constructor [RtfLosslessEditor.RtfLosslessEditor](/api/rtf/officeimo-rtf-rtflosslesseditor/#constructor-ctor-officeimo-rtf-rtfreadresult) parameter `readResult`

Filter members 

Show inherited

## Methods

`public RtfLosslessEditor EditLossless()` [#](#method-editlossless)

[RtfReadResult.cs:72](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.cs#L72)

Creates an editor for targeted syntax-preserving changes.

Returns

`RtfLosslessEditor`

`public IReadOnlyList<OfficeEmbeddedPayloadInfo> GetEmbeddedPayloads(OfficeEmbeddedPayloadInspectionOptions options, CancellationToken cancellationToken = default)` [#](#method-getembeddedpayloads-officeimo-officeembeddedpayloadinspectionoptions-threading-cancellationtoken)

[RtfReadResult.EmbeddedPayloads.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.EmbeddedPayloads.cs#L15)

Returns original-source payload descriptors under explicit limits. Optional hashes scan complete payloads within those limits.

Parameters

**options OfficeIMO.OfficeEmbeddedPayloadInspectionOptions required**

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

Returns

`IReadOnlyList<OfficeEmbeddedPayloadInfo>`

`public OfficeEmbeddedPayloadInspection InspectEmbeddedPayloads(OfficeEmbeddedPayloadInspectionOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-inspectembeddedpayloads-officeimo-officeembeddedpayloadinspectionoptions-threading-cancellationtoken)

[RtfReadResult.EmbeddedPayloads.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.EmbeddedPayloads.cs#L10)

Inventories inert pict and objdata destinations from the original immutable syntax, including semantically omitted objects. Locations are native RTF group character positions, not physical byte offsets or OPC relationships. Hexadecimal lengths remain unknown without a requested bounded read or hash. Semantic and lossless edits do not replace these original-source session bytes.

Parameters

**options OfficeIMO.OfficeEmbeddedPayloadInspectionOptions? = null optional**

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

Returns

`OfficeEmbeddedPayloadInspection`

`public Stream OpenEmbeddedPayload(string id, long maximumBytes, CancellationToken cancellationToken = default)` [#](#method-openembeddedpayload-string-int64-threading-cancellationtoken)

[RtfReadResult.EmbeddedPayloads.cs:22](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.EmbeddedPayloads.cs#L22)

Reads one complete original-source payload under an explicit decoded byte ceiling without activating an object.

Parameters

**id string required**

**maximumBytes long required**

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

Returns

`Stream`

`public RtfDocument RequireValue()` [#](#method-requirevalue)

[RtfReadResult.cs:28](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.cs#L28)

Returns the produced value or throws when the operation did not complete.

Returns

`RtfDocument`

SaveLossless 2 overloads

`public void SaveLossless(string path)` [#](#method-savelossless-string)

[RtfReadResult.cs:78](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.cs#L78)

Saves the original RTF stream to a file without semantic normalization.

Parameters

**path string required**

`public void SaveLossless(Stream stream)` [#](#method-savelossless-io-stream)

[RtfReadResult.cs:86](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.cs#L86)

Saves the original RTF stream to a stream without semantic normalization.

Parameters

**stream System.IO.Stream required**

SaveLosslessAsync 2 overloads

`public Task SaveLosslessAsync(string path, CancellationToken cancellationToken = default)` [#](#method-savelosslessasync-string-threading-cancellationtoken)

[RtfReadResult.Async.cs:11](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.Async.cs#L11)

Saves the original RTF stream to a file without semantic normalization.

Parameters

**path string required**

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

Returns

`Task`

`public Task SaveLosslessAsync(Stream stream, CancellationToken cancellationToken = default)` [#](#method-savelosslessasync-io-stream-threading-cancellationtoken)

[RtfReadResult.Async.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.Async.cs#L20)

Saves the original RTF stream to a stream without semantic normalization.

Parameters

**stream System.IO.Stream required**

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

Returns

`Task`

`public byte[] ToBytesLossless()` [#](#method-tobyteslossless)

[RtfReadResult.cs:50](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.cs#L50)

Serializes the original syntax tree to source-preserving bytes without semantic normalization.

Returns

`byte[]`

`public string ToRtfLossless()` [#](#method-tortflossless)

[RtfReadResult.cs:45](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.cs#L45)

Serializes the original syntax tree without semantic normalization.

Returns

`string`

`public bool TryGetLosslessBytes(out byte[] bytes)` [#](#method-trygetlosslessbytes-byte)

[RtfReadResult.cs:56](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.cs#L56)

Attempts to return source-preserving bytes without throwing for character-only input.

Parameters

**bytes byte[] required**

Returns

`bool`

## 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 RtfDocument Document { get; }` [#](#property-document)

[RtfReadResult.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.cs#L19)

Semantic document model.

`public RtfDocument Value { get; }` [#](#property-value)

[RtfReadResult.cs:22](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.cs#L22)

Gets the produced value, or null when the operation did not complete.

`public bool Succeeded { get; }` [#](#property-succeeded)

[RtfReadResult.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.cs#L25)

Gets whether the operation completed successfully.

`public RtfSyntaxTree SyntaxTree { get; }` [#](#property-syntaxtree)

[RtfReadResult.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.cs#L31)

Loss-preserving syntax tree.

`public IReadOnlyList<RtfDiagnostic> Diagnostics { get; }` [#](#property-diagnostics)

[RtfReadResult.cs:34](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.cs#L34)

Combined parser and binder diagnostics.

`public bool HasOriginalBytes { get; }` [#](#property-hasoriginalbytes)

[RtfReadResult.cs:37](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.cs#L37)

Gets whether the read API retained the exact original source bytes.

`public bool CanWriteLosslessBytes { get; }` [#](#property-canwritelosslessbytes)

[RtfReadResult.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfReadResult.cs#L40)

Gets whether [RtfReadResult.ToBytesLossless](/api/rtf/officeimo-rtf-rtfreadresult/) can return bytes without character transcoding.

<!-- PowerForge markdown artifact sha256:769F24332B777F2D4C237244763E1262ECF4C925B168BAD4438CE7C97B551E63 -->
