API Reference
OfficeImageExportResult
Result returned by dependency-free image export operations.
Inheritance
- Object
- OfficeImageExportResult
Usage
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by
- Method OfficeDrawing.ExportImage
- Method OfficeImageExportBatchBuilder.Export
- Method OfficeImageExportBatchBuilder.ExportAsync
- Method OfficeImageExportBatchBuilder.Save
- Method OfficeImageExportBatchBuilder.SaveAsync
- Method OfficeImageExportBuilder.Export
- Method OfficeImageExportBuilder.Export
- Method OfficeImageExportBuilder.ExportAsync
- Method OfficeImageExportBuilder.Save
- Method OfficeImageExportBuilder.Save
- Method OfficeImageExportBuilder.SaveAsync
- Method OfficeImageExportBuilder.SaveAsync
- Method OfficeImageExportOptions.EnsureAccepted
- Method OfficeImageExportResult.Require
- Method OfficeImageExportResult.Save
- Method OfficeImageExportResult.Save
- Method OfficeImageExportResult.SaveAsync
- Method OfficeImageExportResult.SaveAsync
- Method OfficeImageExportResult.WithDiagnostics
Accepted by parameters
- Method OfficeImageExportAsyncConsumer.BeginInvoke
- Method OfficeImageExportAsyncConsumer.Invoke
- Method OfficeImageExportBatchProcessor.ForEachOrdered``1
- Method OfficeImageExportConsumer.BeginInvoke
- Method OfficeImageExportConsumer.Invoke
- Method OfficeImageExportOptions.EnsureAccepted
- Constructor OfficeImageExportReport.OfficeImageExportReport
Constructors
public OfficeImageExportResult(OfficeImageExportFormat format, Int32 width, Int32 height, Byte[] bytes, String name = null, String source = null, IReadOnlyList<OfficeImageExportDiagnostic> diagnostics = null, String savedPath = null) #Creates an image export result after validating the complete encoded payload, declared format, and dimensions.
Parameters
- format OfficeIMO.Drawing.OfficeImageExportFormat
- width System.Int32
- height System.Int32
- bytes System.Byte[]
- name System.String = null
- source System.String = null
- diagnostics System.Collections.Generic.IReadOnlyList{OfficeIMO.Drawing.OfficeImageExportDiagnostic} = null
- savedPath System.String = null
Exceptions
ArgumentException– The encoded bytes are incomplete or invalid, do not match format, or do not have the declared width and height.
Methods
public OfficeImageExportReport CreateReport() #OfficeImageExportReportCreates an aggregate report for this result.
public OfficeImageExportResult Require(OfficeImageExportPolicy policy) #OfficeImageExportResultThrows when this result violates the supplied acceptance policy.
Parameters
- policy OfficeIMO.Drawing.OfficeImageExportPolicy
public OfficeImageExportResult Save(String path, OfficeImageExportFileConflictPolicy conflictPolicy = FailIfExists) #OfficeImageExportResultSaves the encoded image to a file, appending the canonical extension when the path has none.
Parameters
- path System.String
- conflictPolicy OfficeIMO.Drawing.OfficeImageExportFileConflictPolicy = FailIfExists
public OfficeImageExportResult Save(Stream stream) #OfficeImageExportResultWrites the encoded image to a caller-owned stream without closing it.
Parameters
- stream System.IO.Stream
public async Task<OfficeImageExportResult> SaveAsync(String path, OfficeImageExportFileConflictPolicy conflictPolicy = FailIfExists, CancellationToken cancellationToken = default) #Task<OfficeImageExportResult>Asynchronously saves the encoded image to a file, appending the canonical extension when the path has none.
Parameters
- path System.String
- conflictPolicy OfficeIMO.Drawing.OfficeImageExportFileConflictPolicy = FailIfExists
- cancellationToken System.Threading.CancellationToken = default
public async Task<OfficeImageExportResult> SaveAsync(Stream stream, CancellationToken cancellationToken = default) #Task<OfficeImageExportResult>Asynchronously writes the encoded image to a caller-owned stream without closing it.
Parameters
- stream System.IO.Stream
- cancellationToken System.Threading.CancellationToken = default
public OfficeImageExportResult WithDiagnostics(IReadOnlyList<OfficeImageExportDiagnostic> diagnostics) #OfficeImageExportResultCreates an immutable result copy with replacement diagnostics while preserving payload and batch metadata.
Parameters
- diagnostics System.Collections.Generic.IReadOnlyList{OfficeIMO.Drawing.OfficeImageExportDiagnostic}
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public OfficeImageExportFormat Format { get; } #Output image format.
public Int32 Width { get; } #Output width in pixels for raster formats or CSS pixels for SVG.
public Int32 Height { get; } #Output height in pixels for raster formats or CSS pixels for SVG.
public Double DpiX { get; } #Horizontal encoded resolution in dots per inch, defaulting to 96 when absent.
public Double DpiY { get; } #Vertical encoded resolution in dots per inch, defaulting to 96 when absent.
public Double PhysicalWidthInches { get; } #Physical width in inches according to encoded dimensions and resolution.
public Double PhysicalHeightInches { get; } #Physical height in inches according to encoded dimensions and resolution.
public String MimeType { get; } #Canonical MIME type for the encoded output.
public String FileExtension { get; } #Canonical file extension, including the leading period.
public Byte[] Bytes { get; } #Encoded image bytes.
public Int64 EncodedLength { get; } #Encoded byte count without copying the payload.
public String Name { get; } #Optional result name, such as a sheet or page name.
public String Source { get; } #Optional source reference, such as a sheet range.
public String SavedPath { get; } #Normalized file path when this result was committed by a save operation.
public Nullable<Int32> SequenceIndex { get; } #Zero-based position in the batch that emitted this result, or null for a single export.
public Nullable<Int32> SequenceCount { get; } #Total number of results when known before emission, or null for open-ended streaming batches.
public IReadOnlyList<OfficeImageExportDiagnostic> Diagnostics { get; } #Diagnostics emitted while exporting.