Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

OfficeDrawingSvgExporter

OfficeIMO.Drawing

Namespace
OfficeIMO.Drawing
Assembly
OfficeIMO.Core
Source revision
ba882f6b0d07 with working tree changes
Modifiers
static

Exports dependency-free OfficeIMO drawings to SVG for consumers that need a portable visual fallback.

Inheritance

  • object
  • OfficeDrawingSvgExporter

Methods

ToSvg 6 overloads
public static string ToSvg(OfficeDrawing drawing) #

Converts a drawing to an SVG document.

Parameters

drawing OfficeIMO.Drawing.OfficeDrawing required
Drawing to export.

Returns

string SVG markup representing the drawing.
public static string ToSvg(OfficeDrawing drawing, double scale) #

Converts a drawing to an SVG document with a scaled output surface.

Parameters

drawing OfficeIMO.Drawing.OfficeDrawing required
Drawing to export.
scale double required
Scale applied to the exported SVG width and height.

Returns

string SVG markup representing the drawing.
public static string ToSvg(OfficeDrawing drawing, double scale, OfficeSvgSizeUnit sizeUnit) #

Converts a drawing to an SVG document with an explicit root size unit.

Parameters

drawing OfficeIMO.Drawing.OfficeDrawing required
Drawing to export.
scale double required
Scale applied to the exported SVG width and height.
sizeUnit OfficeIMO.Drawing.OfficeSvgSizeUnit required
Unit written on the root width and height attributes.

Returns

string SVG markup representing the drawing.
public static string ToSvg(OfficeDrawing drawing, double scale, OfficeSvgSizeUnit sizeUnit, IOfficeRasterImageCodec? imageCodec) #

Converts a drawing to SVG and uses an optional shared codec for source images that require transcoding.

Parameters

drawing OfficeIMO.Drawing.OfficeDrawing required
scale double required
sizeUnit OfficeIMO.Drawing.OfficeSvgSizeUnit required
imageCodec OfficeIMO.Drawing.IOfficeRasterImageCodec? required

Returns

string
public static string ToSvg(OfficeDrawing drawing, double scale, OfficeSvgSizeUnit sizeUnit, IOfficeRasterImageCodec? imageCodec, string? resourceIdPrefix) #

Converts a drawing to SVG and prefixes every generated resource identifier for safe inline composition.

Parameters

drawing OfficeIMO.Drawing.OfficeDrawing required
scale double required
sizeUnit OfficeIMO.Drawing.OfficeSvgSizeUnit required
imageCodec OfficeIMO.Drawing.IOfficeRasterImageCodec? required
resourceIdPrefix string? required

Returns

string
public static string ToSvg(OfficeDrawing drawing, double scale, OfficeSvgSizeUnit sizeUnit, IOfficeRasterImageCodec? imageCodec, string? resourceIdPrefix, CancellationToken cancellationToken) #

Converts a drawing to SVG with bounded cancellation and a safe generated-resource prefix.

Parameters

drawing OfficeIMO.Drawing.OfficeDrawing required
scale double required
sizeUnit OfficeIMO.Drawing.OfficeSvgSizeUnit required
imageCodec OfficeIMO.Drawing.IOfficeRasterImageCodec? required
resourceIdPrefix string? required
cancellationToken System.Threading.CancellationToken required

Returns

string
ToSvgBytes 6 overloads
public static byte[] ToSvgBytes(OfficeDrawing drawing) #

Converts a drawing to UTF-8 SVG bytes.

Parameters

drawing OfficeIMO.Drawing.OfficeDrawing required
Drawing to export.

Returns

byte[] UTF-8 encoded SVG bytes.
public static byte[] ToSvgBytes(OfficeDrawing drawing, double scale) #

Converts a drawing to UTF-8 SVG bytes with a scaled output surface.

Parameters

drawing OfficeIMO.Drawing.OfficeDrawing required
Drawing to export.
scale double required
Scale applied to the exported SVG width and height.

Returns

byte[] UTF-8 encoded SVG bytes.
public static byte[] ToSvgBytes(OfficeDrawing drawing, double scale, OfficeSvgSizeUnit sizeUnit) #

Converts a drawing to UTF-8 SVG bytes with an explicit root size unit.

Parameters

drawing OfficeIMO.Drawing.OfficeDrawing required
scale double required
sizeUnit OfficeIMO.Drawing.OfficeSvgSizeUnit required

Returns

byte[]
public static byte[] ToSvgBytes(OfficeDrawing drawing, double scale, OfficeSvgSizeUnit sizeUnit, IOfficeRasterImageCodec? imageCodec) #

Converts a drawing to UTF-8 SVG bytes and uses an optional shared image codec.

Parameters

drawing OfficeIMO.Drawing.OfficeDrawing required
scale double required
sizeUnit OfficeIMO.Drawing.OfficeSvgSizeUnit required
imageCodec OfficeIMO.Drawing.IOfficeRasterImageCodec? required

Returns

byte[]
public static byte[] ToSvgBytes(OfficeDrawing drawing, double scale, OfficeSvgSizeUnit sizeUnit, IOfficeRasterImageCodec? imageCodec, string? resourceIdPrefix) #

Converts a drawing to UTF-8 SVG bytes and prefixes generated resource identifiers for safe inline composition.

Parameters

drawing OfficeIMO.Drawing.OfficeDrawing required
scale double required
sizeUnit OfficeIMO.Drawing.OfficeSvgSizeUnit required
imageCodec OfficeIMO.Drawing.IOfficeRasterImageCodec? required
resourceIdPrefix string? required

Returns

byte[]
public static byte[] ToSvgBytes(OfficeDrawing drawing, double scale, OfficeSvgSizeUnit sizeUnit, IOfficeRasterImageCodec? imageCodec, string? resourceIdPrefix, CancellationToken cancellationToken) #

Converts a drawing to cancellable UTF-8 SVG bytes and prefixes generated resource identifiers.

Parameters

drawing OfficeIMO.Drawing.OfficeDrawing required
scale double required
sizeUnit OfficeIMO.Drawing.OfficeSvgSizeUnit required
imageCodec OfficeIMO.Drawing.IOfficeRasterImageCodec? required
resourceIdPrefix string? required
cancellationToken System.Threading.CancellationToken required

Returns

byte[]