# OfficeSvgDrawingReaderOptions

Controls bounded SVG import limits for trusted inputs that legitimately contain many elements.

Class 

`OfficeIMO.Drawing`

**Namespace**

`OfficeIMO.Drawing`

**Assembly**

`OfficeIMO.Core`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[OfficeSvgDrawingReaderOptions.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeSvgDrawingReaderOptions.cs#L19)

**Modifiers**

sealed

Controls bounded SVG import limits for trusted inputs that legitimately contain many elements.

## Inheritance

- object
- OfficeSvgDrawingReaderOptions

## Usage

Explore 4 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 4

- Method [OfficeSvgDrawingReader.InspectContentSafety](/api/core/officeimo-drawing-officesvgdrawingreader/#method-inspectcontentsafety-byte-officeimo-contentsafety-officecontentsafetyoptions-officeimo-drawing-officesvgdrawingreaderoptions) parameter `readerOptions`
- Method [OfficeSvgDrawingReader.IsWithinSafetyLimits](/api/core/officeimo-drawing-officesvgdrawingreader/#method-iswithinsafetylimits-byte-officeimo-drawing-officesvgdrawingreaderoptions) parameter `options`
- Method [OfficeSvgDrawingReader.RemoveSelectedContent](/api/core/officeimo-drawing-officesvgdrawingreader/#method-removeselectedcontent-byte-officeimo-contentsafety-officecontentcleanupselection-officeimo-contentsafety-officecontentcleanupoptions-officeimo-drawing-officesvgdrawingreaderoptions) parameter `readerOptions`
- Method [OfficeSvgDrawingReader.TryRead](/api/core/officeimo-drawing-officesvgdrawingreader/#method-tryread-byte-officeimo-drawing-officesvgdrawingreaderoptions-officeimo-drawing-officedrawing) parameter `options`

Filter members 

Show inherited

## Constructors

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

[OfficeSvgDrawingReaderOptions.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeSvgDrawingReaderOptions.cs#L19)

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

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

Cancellation observed during SVG import and managed filter processing.

`public string DefaultFontFamily { get; set; }` [#](#property-defaultfontfamily)

[OfficeSvgDrawingReaderOptions.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeSvgDrawingReaderOptions.cs#L19)

Font family used by SVG text that does not declare one. The default preserves the existing shared-drawing contract; browser-oriented hosts can select a generic family that matches their user-agent profile.

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

[OfficeSvgDrawingReaderOptions.cs:25](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeSvgDrawingReaderOptions.cs#L25)

Scoped font faces available when SVG text must be converted to painted vector outlines. Callers can register web fonts without changing process-wide font state.

`public OfficeSvgForeignObjectRenderer? ForeignObjectRenderer { get; set; }` [#](#property-foreignobjectrenderer)

[OfficeSvgDrawingReaderOptions.cs:34](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeSvgDrawingReaderOptions.cs#L34)

Optional caller-owned renderer for bounded inline XHTML inside SVG foreignObject elements. The returned drawing must use the exact viewport dimensions supplied by the context.

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

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

Width of a caller-resolved SVG viewport, in CSS pixels. Supply with [OfficeSvgDrawingReaderOptions.ViewportHeight](/api/core/officeimo-drawing-officesvgdrawingreaderoptions/) when a host layout owns the viewport size.

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

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

Height of a caller-resolved SVG viewport, in CSS pixels. Supply with [OfficeSvgDrawingReaderOptions.ViewportWidth](/api/core/officeimo-drawing-officesvgdrawingreaderoptions/) when a host layout owns the viewport size.

`public int MaximumElements { get; set; }` [#](#property-maximumelements)

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

Maximum number of descendant and expanded reference elements. Increase this only for trusted SVG input.

`public int MaximumGeometryCommands { get; set; }` [#](#property-maximumgeometrycommands)

[OfficeSvgDrawingReaderOptions.cs:84](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeSvgDrawingReaderOptions.cs#L84)

Maximum geometric path/polygon commands, including expanded references. Defaults to 20000; explicitly bounded fixed-page imports can request up to 1000000. Text, effects, and raster safety retain their separate limits.

`public double MaximumViewportDimension { get; set; }` [#](#property-maximumviewportdimension)

[OfficeSvgDrawingReaderOptions.cs:87](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeSvgDrawingReaderOptions.cs#L87)

Maximum SVG viewport width or height. Increase this only for trusted SVG input.

`public double MaximumViewportPixels { get; set; }` [#](#property-maximumviewportpixels)

[OfficeSvgDrawingReaderOptions.cs:90](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeSvgDrawingReaderOptions.cs#L90)

Maximum SVG viewport width-times-height area. Increase this only for trusted SVG input.

`public int MaximumContentSafetyVisualComparisons { get; set; }` [#](#property-maximumcontentsafetyvisualcomparisons)

[OfficeSvgDrawingReaderOptions.cs:96](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeSvgDrawingReaderOptions.cs#L96)

Maximum full-document visual comparisons used for paint-order and background evidence. Set this to zero to use structural inspection only; the report records that visual comparison was disabled.

`public long MaximumContentSafetyVisualPixels { get; set; }` [#](#property-maximumcontentsafetyvisualpixels)

[OfficeSvgDrawingReaderOptions.cs:99](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeSvgDrawingReaderOptions.cs#L99)

Cumulative rendered-pixel work allowed across the SVG content-safety baseline and comparison renders.

## Fields

`public const int DefaultMaximumElements` [#](#field-defaultmaximumelements)

[OfficeSvgDrawingReaderOptions.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeSvgDrawingReaderOptions.cs#L49)

Default maximum number of descendant and expanded reference elements.

Value: `10000`

`public const int MaximumAllowedElements` [#](#field-maximumallowedelements)

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

Hard maximum accepted by the reader, even when explicitly requested.

Value: `100000`

`public const double DefaultMaximumViewportDimension` [#](#field-defaultmaximumviewportdimension)

[OfficeSvgDrawingReaderOptions.cs:55](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeSvgDrawingReaderOptions.cs#L55)

Default maximum width or height of an imported SVG viewport.

Value: `8192`

`public const double MaximumAllowedViewportDimension` [#](#field-maximumallowedviewportdimension)

[OfficeSvgDrawingReaderOptions.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeSvgDrawingReaderOptions.cs#L58)

Hard maximum viewport dimension accepted for explicitly trusted SVG input.

Value: `1000000`

`public const double DefaultMaximumViewportPixels` [#](#field-defaultmaximumviewportpixels)

[OfficeSvgDrawingReaderOptions.cs:61](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeSvgDrawingReaderOptions.cs#L61)

Default maximum viewport area accepted by the reader.

Value: `16777216`

`public const double MaximumAllowedViewportPixels` [#](#field-maximumallowedviewportpixels)

[OfficeSvgDrawingReaderOptions.cs:64](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeSvgDrawingReaderOptions.cs#L64)

Hard maximum viewport area accepted for explicitly trusted SVG input.

Value: `268435456`

`public const int DefaultMaximumContentSafetyVisualComparisons` [#](#field-defaultmaximumcontentsafetyvisualcomparisons)

[OfficeSvgDrawingReaderOptions.cs:67](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeSvgDrawingReaderOptions.cs#L67)

Default maximum number of full SVG visual comparisons performed by content-safety inspection.

Value: `32`

`public const int MaximumAllowedContentSafetyVisualComparisons` [#](#field-maximumallowedcontentsafetyvisualcomparisons)

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

Hard maximum number of SVG visual comparisons accepted from a caller.

Value: `128`

`public const long DefaultMaximumContentSafetyVisualPixels` [#](#field-defaultmaximumcontentsafetyvisualpixels)

[OfficeSvgDrawingReaderOptions.cs:73](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Core/OfficeSvgDrawingReaderOptions.cs#L73)

Default cumulative rendered-pixel budget for SVG content-safety inspection.

Value: `33554432`

`public const long MaximumAllowedContentSafetyVisualPixels` [#](#field-maximumallowedcontentsafetyvisualpixels)

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

Hard maximum cumulative rendered-pixel budget accepted from a caller.

Value: `134217728`

<!-- PowerForge markdown artifact sha256:0998201A7958C2A55DF295BA72466DC466000909B9EDCD98B425357682BA0DBA -->
