Class RtfCodec
- Namespace
- RichEdit.Core.Rtf
- Assembly
- RichEdit.Core.dll
Streams structured rich documents using RTF as their sole interchange representation.
public static class RtfCodec
- Inheritance
-
RtfCodec
- Inherited Members
Methods
Assess(RichDocumentSnapshot)
Assesses the same immutable state used by the writer before a host opens or replaces its destination.
public static ImmutableArray<RtfDiagnostic> Assess(RichDocumentSnapshot snapshot)
Parameters
snapshotRichDocumentSnapshot
Returns
ReadAsync(Stream, RtfReadOptions?, CancellationToken)
Reads and validates a detached snapshot. Unsupported content is reported, never silently retained as unsafe opaque data.
public static Task<RtfReadResult> ReadAsync(Stream input, RtfReadOptions? options = null, CancellationToken cancellationToken = default)
Parameters
inputStreamoptionsRtfReadOptionscancellationTokenCancellationToken
Returns
WriteAsync(RichDocumentSnapshot, Stream, CancellationToken)
Writes a lossless RTF representation of supported authored state. Assessment completes before any bytes are written.
public static Task WriteAsync(RichDocumentSnapshot snapshot, Stream output, CancellationToken cancellationToken = default)
Parameters
snapshotRichDocumentSnapshotoutputStreamcancellationTokenCancellationToken
Returns
Remarks
Pending revisions use retained RTF contexts with ignorable identity and group metadata. Readers that omit this metadata receive the current body. Cancellation may leave a partial stream; atomic file replacement belongs to the host storage service.