# OfficeImageExportOptions

Shared options for dependency-free image export pipelines.

Class 

`OfficeIMO.Drawing`

**Namespace**

`OfficeIMO.Drawing`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[OfficeImageExportOptions.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L40)

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](/api/core/officeimo-drawing-officedrawing/#method-toimage-officeimo-drawing-officeimageexportformat-officeimo-drawing-officeimageexportoptions-threading-cancellationtoken) parameter `options`
- Method [OfficeRasterExportPlanner.Resolve](/api/core/officeimo-drawing-officerasterexportplanner/#method-resolve-double-double-officeimo-drawing-officeimageexportformat-officeimo-drawing-officeimageexportoptions-string) parameter `options`

Filter members 

Show inherited

## Constructors

`public OfficeImageExportOptions()` [#](#constructor-ctor)

[OfficeImageExportOptions.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L40)

## Methods

`public OfficeImageExportResult EnsureAccepted(OfficeImageExportResult result)` [#](#method-ensureaccepted-officeimo-drawing-officeimageexportresult)

[OfficeImageExportOptions.cs:154](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L154)

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 required**

Returns

`OfficeImageExportResult`

`public double GetEffectiveScale(double logicalWidth, double logicalHeight)` [#](#method-geteffectivescale-double-double)

[OfficeImageExportOptions.cs:273](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L273)

Resolves the requested scale after applying optional output dimension caps while preserving aspect ratio.

Parameters

**logicalWidth double required**

**logicalHeight double required**

Returns

`double`

`public static void ValidateScale(double scale, string paramName = "scale")` [#](#method-validatescale-double-string)

[OfficeImageExportOptions.cs:144](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L144)

Validates that an export scale is finite and positive.

Parameters

**scale double required**

Scale value to validate.

**paramName string = "scale" optional**

Parameter name used for the thrown exception.

## 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 OfficeImageExportFormat Format { get; set; }` [#](#property-format)

[OfficeImageExportOptions.cs:12](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L12)

Image encoding used by options-based exports.

`public OfficePageSelector? PageSelector { get; set; }` [#](#property-pageselector)

[OfficeImageExportOptions.cs:17](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L17)

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; }` [#](#property-fileconflictpolicy)

[OfficeImageExportOptions.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L20)

Controls an existing file at the requested output path.

`public bool FailOnLoss { get; set; }` [#](#property-failonloss)

[OfficeImageExportOptions.cs:23](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L23)

Rejects fidelity loss before an image is written.

`public double Scale { get; set; }` [#](#property-scale)

[OfficeImageExportOptions.cs:40](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L40)

Output scale multiplier. A value of 2 creates a 2x raster or SVG surface.

`public int? MaximumOutputWidth { get; set; }` [#](#property-maximumoutputwidth)

[OfficeImageExportOptions.cs:46](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L46)

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; }` [#](#property-maximumoutputheight)

[OfficeImageExportOptions.cs:52](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L52)

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; }` [#](#property-backgroundcolor)

[OfficeImageExportOptions.cs:57](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L57)

Background color used behind rendered document content.

`public OfficeRasterEncodingOptions RasterEncoding { get; set; }` [#](#property-rasterencoding)

[OfficeImageExportOptions.cs:62](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L62)

Format-specific settings used when the selected output is raster-based, including PNG and lossless WebP encoding effort.

`public bool SvgTextAsPaths { get; set; }` [#](#property-svgtextaspaths)

[OfficeImageExportOptions.cs:70](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L70)

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; }` [#](#property-maximumrasterpixels)

[OfficeImageExportOptions.cs:76](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L76)

Maximum number of pixels allocated for one raster export. Encoder-specific limits may reduce the effective ceiling further.

`public OfficeRasterOverflowBehavior RasterOverflowBehavior { get; set; }` [#](#property-rasteroverflowbehavior)

[OfficeImageExportOptions.cs:81](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L81)

Controls whether an oversized raster request is reduced to a safe scale or rejected.

`public IOfficeRasterImageCodec? ImageCodec { get; set; }` [#](#property-imagecodec)

[OfficeImageExportOptions.cs:86](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L86)

Optional decoder for embedded source-image formats not handled by the dependency-free Drawing core.

`public double? TargetDpi { get; set; }` [#](#property-targetdpi)

[OfficeImageExportOptions.cs:89](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L89)

Optional target output density. Document adapters map logical units to this DPI.

`public OfficeFontFaceCollection Fonts { get; set; }` [#](#property-fonts)

[OfficeImageExportOptions.cs:92](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L92)

Caller-supplied deterministic TrueType faces used before platform fallback.

`public IOfficeTextShapingProvider? TextShapingProvider { get; set; }` [#](#property-textshapingprovider)

[OfficeImageExportOptions.cs:102](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L102)

Optional host text shaper used for deterministic complex-script raster output.

`public string? TextShapingLanguage { get; set; }` [#](#property-textshapinglanguage)

[OfficeImageExportOptions.cs:105](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L105)

Optional BCP 47 language hint passed to [OfficeImageExportOptions.TextShapingProvider](/api/core/officeimo-drawing-officeimageexportoptions/).

`public OfficeImageExportPolicy Policy { get; set; }` [#](#property-policy)

[OfficeImageExportOptions.cs:108](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L108)

Diagnostic acceptance policy applied before an export is returned or committed.

`public IProgress<OfficeImageExportProgress>? Progress { get; set; }` [#](#property-progress)

[OfficeImageExportOptions.cs:111](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L111)

Optional progress observer for rendering and saving.

`public int MaximumOutputCount { get; set; }` [#](#property-maximumoutputcount)

[OfficeImageExportOptions.cs:114](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L114)

Maximum number of results accepted from one batch export.

`public long MaximumTotalRasterPixels { get; set; }` [#](#property-maximumtotalrasterpixels)

[OfficeImageExportOptions.cs:117](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L117)

Maximum aggregate raster pixels accepted from one batch export.

`public long MaximumTotalEncodedBytes { get; set; }` [#](#property-maximumtotalencodedbytes)

[OfficeImageExportOptions.cs:120](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L120)

Maximum aggregate encoded bytes accepted from one batch export.

`public TimeSpan RenderTimeout { get; set; }` [#](#property-rendertimeout)

[OfficeImageExportOptions.cs:127](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L127)

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; }` [#](#property-maximumdegreeofparallelism)

[OfficeImageExportOptions.cs:133](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L133)

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; }` [#](#property-logicalunitsperinch)

[OfficeImageExportOptions.cs:136](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L136)

Logical document units represented by one inch. Point-based adapters override with 72.

## Fields

`public const long DefaultMaximumRasterPixels` [#](#field-defaultmaximumrasterpixels)

[OfficeImageExportOptions.cs:26](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L26)

Default maximum number of pixels allocated for one raster export.

Value: `50000000`

`public const int DefaultMaximumOutputCount` [#](#field-defaultmaximumoutputcount)

[OfficeImageExportOptions.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L29)

Default maximum number of images produced by one batch operation.

Value: `10000`

`public const long DefaultMaximumTotalRasterPixels` [#](#field-defaultmaximumtotalrasterpixels)

[OfficeImageExportOptions.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L32)

Default maximum aggregate raster pixels produced by one batch operation.

Value: `500000000`

`public const long DefaultMaximumTotalEncodedBytes` [#](#field-defaultmaximumtotalencodedbytes)

[OfficeImageExportOptions.cs:35](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeImageExportOptions.cs#L35)

Default maximum aggregate encoded bytes produced by one batch operation.

Value: `1073741824`

<!-- PowerForge markdown artifact sha256:3CD78CDA2E111468CCBD499D902560DDCCD02636C7A87C5D86CBD087166D6CDE -->
