RtfReadResult
OfficeIMO.Rtf
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
- Method RtfDocument.LoadResultAsync
- Method RtfDocument.ParseResult
- Method RtfLosslessEditor.ToReadResult
Accepted by parameters 1
- Constructor RtfLosslessEditor.RtfLosslessEditor
Methods
public RtfLosslessEditor EditLossless() #Creates an editor for targeted syntax-preserving changes.
Returns
RtfLosslessEditorpublic IReadOnlyList<OfficeEmbeddedPayloadInfo> GetEmbeddedPayloads(OfficeEmbeddedPayloadInspectionOptions options, CancellationToken cancellationToken = default) #Returns original-source payload descriptors under explicit limits. Optional hashes scan complete payloads within those limits.
Parameters
- options OfficeIMO.OfficeEmbeddedPayloadInspectionOptions
- cancellationToken System.Threading.CancellationToken = default
Returns
IReadOnlyList<OfficeEmbeddedPayloadInfo>public OfficeEmbeddedPayloadInspection InspectEmbeddedPayloads(OfficeEmbeddedPayloadInspectionOptions? options = null, CancellationToken cancellationToken = default) #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
- cancellationToken System.Threading.CancellationToken = default
Returns
OfficeEmbeddedPayloadInspectionpublic Stream OpenEmbeddedPayload(string id, long maximumBytes, CancellationToken cancellationToken = default) #Reads one complete original-source payload under an explicit decoded byte ceiling without activating an object.
Parameters
- id string
- maximumBytes long
- cancellationToken System.Threading.CancellationToken = default
Returns
Streampublic RtfDocument RequireValue() #Returns the produced value or throws when the operation did not complete.
Returns
RtfDocumentpublic Task SaveLosslessAsync(string path, CancellationToken cancellationToken = default) #Saves the original RTF stream to a file without semantic normalization.
Parameters
- path string
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic Task SaveLosslessAsync(Stream stream, CancellationToken cancellationToken = default) #Saves the original RTF stream to a stream without semantic normalization.
Parameters
- stream System.IO.Stream
- cancellationToken System.Threading.CancellationToken = default
Returns
Taskpublic byte[] ToBytesLossless() #Serializes the original syntax tree to source-preserving bytes without semantic normalization.
Returns
byte[]public string ToRtfLossless() #Serializes the original syntax tree without semantic normalization.
Returns
stringpublic bool TryGetLosslessBytes(out byte[] bytes) #Attempts to return source-preserving bytes without throwing for character-only input.
Parameters
- bytes byte[]
Returns
boolInherited Methods
Properties
public RtfDocument Value { get; } #Gets the produced value, or null when the operation did not complete.
public bool Succeeded { get; } #Gets whether the operation completed successfully.
public IReadOnlyList<RtfDiagnostic> Diagnostics { get; } #Combined parser and binder diagnostics.
public bool HasOriginalBytes { get; } #Gets whether the read API retained the exact original source bytes.
public bool CanWriteLosslessBytes { get; } #Gets whether RtfReadResult.ToBytesLossless can return bytes without character transcoding.