OfficeImageExportOptions
OfficeIMO.Drawing
Shared options for dependency-free image export pipelines.
Inheritance
- object
- OfficeImageExportOptions
Remarks
Document packages should inherit from this type for format-neutral settings and keep document-specific layout policy in their own option types.
Usage
Explore 2 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 2
- Method OfficeDrawing.ToImage
- Method OfficeRasterExportPlanner.Resolve
Constructors
public OfficeImageExportOptions() #Methods
public OfficeImageExportResult EnsureAccepted(OfficeImageExportResult result) #Validates this options snapshot and throws when an exported result violates its acceptance policy. Format packages call this at their direct export boundary so fluent and non-fluent APIs behave identically.
Parameters
- result OfficeIMO.Drawing.OfficeImageExportResult
Returns
OfficeImageExportResultpublic double GetEffectiveScale(double logicalWidth, double logicalHeight) #Resolves the requested scale after applying optional output dimension caps while preserving aspect ratio.
Parameters
- logicalWidth double
- logicalHeight double
Returns
doublepublic static void ValidateScale(double scale, string paramName = "scale") #Validates that an export scale is finite and positive.
Parameters
- scale double
- Scale value to validate.
- paramName string = "scale"
- Parameter name used for the thrown exception.
Inherited Methods
Properties
public OfficeImageExportFormat Format { get; set; } #Image encoding used by options-based exports.
public OfficePageSelector? PageSelector { get; set; } #One-based batch source surfaces in caller order, including repeated surfaces. Null uses the format-specific selection. For documents these are pages, for presentations slides, for workbooks worksheets, and for EPUB publications chapters. For batches, a supplied selector overrides format-specific index, range and name filters; layout and hidden-content policies still apply.
public OfficeImageExportFileConflictPolicy FileConflictPolicy { get; set; } #Controls an existing file at the requested output path.
public bool FailOnLoss { get; set; } #Rejects fidelity loss before an image is written.
public double Scale { get; set; } #Output scale multiplier. A value of 2 creates a 2x raster or SVG surface.
public int? MaximumOutputWidth { get; set; } #Optional maximum output width in pixels (or CSS pixels for SVG). The requested scale is reduced as needed while preserving aspect ratio; smaller outputs are never enlarged.
public int? MaximumOutputHeight { get; set; } #Optional maximum output height in pixels (or CSS pixels for SVG). The requested scale is reduced as needed while preserving aspect ratio; smaller outputs are never enlarged.
public OfficeColor BackgroundColor { get; set; } #Background color used behind rendered document content.
public OfficeRasterEncodingOptions RasterEncoding { get; set; } #Format-specific settings used when the selected output is raster-based, including PNG and lossless WebP encoding effort.
public bool SvgTextAsPaths { get; set; } #Exports eligible SVG text as bounded glyph outlines instead of embedding its font. The default is false. Single-line horizontal ASCII text with a registered outline face is supported; decorated, wrapped, vertical, mixed-fallback and unsupported shaping runs retain SVG text and the referenced font. This does not subset retained font programs.
public long MaximumRasterPixels { get; set; } #Maximum number of pixels allocated for one raster export. Encoder-specific limits may reduce the effective ceiling further.
public OfficeRasterOverflowBehavior RasterOverflowBehavior { get; set; } #Controls whether an oversized raster request is reduced to a safe scale or rejected.
public IOfficeRasterImageCodec? ImageCodec { get; set; } #Optional decoder for embedded source-image formats not handled by the dependency-free Drawing core.
public double? TargetDpi { get; set; } #Optional target output density. Document adapters map logical units to this DPI.
public OfficeFontFaceCollection Fonts { get; set; } #Caller-supplied deterministic TrueType faces used before platform fallback.
public IOfficeTextShapingProvider? TextShapingProvider { get; set; } #Optional host text shaper used for deterministic complex-script raster output.
public string? TextShapingLanguage { get; set; } #Optional BCP 47 language hint passed to OfficeImageExportOptions.TextShapingProvider.
public OfficeImageExportPolicy Policy { get; set; } #Diagnostic acceptance policy applied before an export is returned or committed.
public IProgress<OfficeImageExportProgress>? Progress { get; set; } #Optional progress observer for rendering and saving.
public int MaximumOutputCount { get; set; } #Maximum number of results accepted from one batch export.
public long MaximumTotalRasterPixels { get; set; } #Maximum aggregate raster pixels accepted from one batch export.
public long MaximumTotalEncodedBytes { get; set; } #Maximum aggregate encoded bytes accepted from one batch export.
public TimeSpan RenderTimeout { get; set; } #Maximum duration allowed for one render operation. The default is unlimited. Cancellation-aware renderers are interrupted at the deadline; legacy renderers that do not observe cancellation are rejected when they return after the deadline.
public int MaximumDegreeOfParallelism { get; set; } #Maximum concurrent independent renders. Defaults to one because callers must opt in when their document model can be read concurrently.
public virtual double LogicalUnitsPerInch { get; } #Logical document units represented by one inch. Point-based adapters override with 72.
Fields
public const long DefaultMaximumRasterPixels #Default maximum number of pixels allocated for one raster export.
50000000public const int DefaultMaximumOutputCount #Default maximum number of images produced by one batch operation.
10000public const long DefaultMaximumTotalRasterPixels #Default maximum aggregate raster pixels produced by one batch operation.
500000000public const long DefaultMaximumTotalEncodedBytes #Default maximum aggregate encoded bytes produced by one batch operation.
1073741824