Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

OfficeSvgFormatting

Namespace OfficeIMO.Drawing
Assembly OfficeIMO.Core
Modifiers static

Shared SVG formatting helpers used by OfficeIMO renderers.

Inheritance

  • Object
  • OfficeSvgFormatting

Methods

public static StringBuilder AppendAttribute(StringBuilder builder, String attributeName, String value) #
Returns: StringBuilder

Appends an escaped SVG attribute to a markup builder.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
attributeName System.String requiredposition: 1
Attribute name.
value System.String requiredposition: 2
Attribute value.

Returns

The supplied builder for call chaining.

AppendCircleElement 2 overloads
public static StringBuilder AppendCircleElement(StringBuilder builder, Double cx, Double cy, Double radius, String attributes = null) #
Returns: StringBuilder

Appends a complete SVG circle element using shared numeric formatting.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
cx System.Double requiredposition: 1
Circle center x-coordinate.
cy System.Double requiredposition: 2
Circle center y-coordinate.
radius System.Double requiredposition: 3
Circle radius.
attributes System.String = null optionalposition: 4
Optional already-formatted SVG attributes to append after the geometry.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendCircleElement(StringBuilder builder, Double cx, Double cy, Double radius, OfficeColor fill) #
Returns: StringBuilder

Appends a complete filled SVG circle element using shared paint formatting.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
cx System.Double requiredposition: 1
Circle center x-coordinate.
cy System.Double requiredposition: 2
Circle center y-coordinate.
radius System.Double requiredposition: 3
Circle radius.
fill OfficeIMO.Drawing.OfficeColor requiredposition: 4
Circle fill color.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendClipPathReference(StringBuilder builder, String clipPathId) #
Returns: StringBuilder

Appends an SVG clip-path reference attribute for the supplied clip path identifier.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
clipPathId System.String requiredposition: 1
Clip path identifier without the leading #.

Returns

The supplied builder for call chaining.

AppendEllipseElement 2 overloads
public static StringBuilder AppendEllipseElement(StringBuilder builder, Double cx, Double cy, Double rx, Double ry, String attributes = null) #
Returns: StringBuilder

Appends a complete SVG ellipse element using shared numeric formatting.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
cx System.Double requiredposition: 1
Ellipse center x-coordinate.
cy System.Double requiredposition: 2
Ellipse center y-coordinate.
rx System.Double requiredposition: 3
Horizontal radius.
ry System.Double requiredposition: 4
Vertical radius.
attributes System.String = null optionalposition: 5
Optional already-formatted SVG attributes to append after the geometry.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendEllipseElement(StringBuilder builder, Double cx, Double cy, Double rx, Double ry, OfficeColor fill) #
Returns: StringBuilder

Appends a complete filled SVG ellipse element using shared paint formatting.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
cx System.Double requiredposition: 1
Ellipse center x-coordinate.
cy System.Double requiredposition: 2
Ellipse center y-coordinate.
rx System.Double requiredposition: 3
Horizontal radius.
ry System.Double requiredposition: 4
Vertical radius.
fill OfficeIMO.Drawing.OfficeColor requiredposition: 5
Ellipse fill color.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendHatchPatternRectangle(StringBuilder builder, Double x, Double y, Double width, Double height, OfficeColor color, Double step, Double lineWidth, OfficeHatchPatternKind pattern) #
Returns: StringBuilder

Appends SVG elements for a shared hatch pattern over the supplied rectangle.

Parameters

builder System.Text.StringBuilder requiredposition: 0
x System.Double requiredposition: 1
y System.Double requiredposition: 2
width System.Double requiredposition: 3
height System.Double requiredposition: 4
color OfficeIMO.Drawing.OfficeColor requiredposition: 5
step System.Double requiredposition: 6
lineWidth System.Double requiredposition: 7
pattern OfficeIMO.Drawing.OfficeHatchPatternKind requiredposition: 8

Returns

The supplied builder for call chaining.

public static StringBuilder AppendLinearGradientDefinition(StringBuilder builder, String id, OfficeLinearGradient gradient) #
Returns: StringBuilder

Appends a reusable SVG linear-gradient definition.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
id System.String requiredposition: 1
Gradient identifier.
gradient OfficeIMO.Drawing.OfficeLinearGradient requiredposition: 2
Gradient definition.

Returns

The supplied builder for call chaining.

AppendLineElement 2 overloads
public static StringBuilder AppendLineElement(StringBuilder builder, Double x1, Double y1, Double x2, Double y2, String attributes = null) #
Returns: StringBuilder

Appends a complete SVG line element using shared numeric formatting.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
x1 System.Double requiredposition: 1
Line start x-coordinate.
y1 System.Double requiredposition: 2
Line start y-coordinate.
x2 System.Double requiredposition: 3
Line end x-coordinate.
y2 System.Double requiredposition: 4
Line end y-coordinate.
attributes System.String = null optionalposition: 5
Optional already-formatted SVG attributes to append after the coordinates.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendLineElement(StringBuilder builder, Double x1, Double y1, Double x2, Double y2, OfficeColor stroke, Double strokeWidth, OfficeStrokeDashStyle dashStyle = Solid, Nullable<OfficeStrokeLineCap> lineCap = null) #
Returns: StringBuilder

Appends a complete stroked SVG line element using shared paint, dash, and cap formatting.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
x1 System.Double requiredposition: 1
Line start x-coordinate.
y1 System.Double requiredposition: 2
Line start y-coordinate.
x2 System.Double requiredposition: 3
Line end x-coordinate.
y2 System.Double requiredposition: 4
Line end y-coordinate.
stroke OfficeIMO.Drawing.OfficeColor requiredposition: 5
Stroke color.
strokeWidth System.Double requiredposition: 6
Stroke width.
dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle = Solid optionalposition: 7
Stroke dash style.
lineCap System.Nullable{OfficeIMO.Drawing.OfficeStrokeLineCap} = null optionalposition: 8
Optional stroke line cap.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendMatrixTransformAttribute(StringBuilder builder, OfficeTransform transform, Double placementX = 0, Double placementY = 0) #
Returns: StringBuilder

Appends an SVG matrix transform attribute using shared invariant numeric formatting.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
transform OfficeIMO.Drawing.OfficeTransform requiredposition: 1
Affine transform matrix.
placementX System.Double = 0 optionalposition: 2
Additional x placement offset applied to the transform.
placementY System.Double = 0 optionalposition: 3
Additional y placement offset applied to the transform.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendMoveLinePathData(StringBuilder builder, IReadOnlyList<OfficePoint> points, Boolean closePath = false) #
Returns: StringBuilder

Appends SVG path data for a move/line polyline or polygon using shared invariant numeric formatting.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
points System.Collections.Generic.IReadOnlyList{OfficeIMO.Drawing.OfficePoint} requiredposition: 1
Points to serialize.
closePath System.Boolean = false optionalposition: 2
When true, appends a close-path command after at least one point.

Returns

The supplied builder for call chaining.

AppendNestedSvg 2 overloads
public static StringBuilder AppendNestedSvg(StringBuilder builder, Double x, Double y, Double width, Double height, String innerContent) #
Returns: StringBuilder

Appends a nested SVG viewport with the supplied inner content.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
x System.Double requiredposition: 1
Nested viewport x-coordinate.
y System.Double requiredposition: 2
Nested viewport y-coordinate.
width System.Double requiredposition: 3
Nested viewport width.
height System.Double requiredposition: 4
Nested viewport height.
innerContent System.String requiredposition: 5
SVG content to place inside the nested viewport.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendNestedSvg(StringBuilder builder, Double x, Double y, Double width, Double height, Double viewBoxWidth, Double viewBoxHeight, String innerContent) #
Returns: StringBuilder

Appends a nested SVG viewport with explicit local coordinate bounds and the supplied inner content.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
x System.Double requiredposition: 1
Nested viewport x-coordinate.
y System.Double requiredposition: 2
Nested viewport y-coordinate.
width System.Double requiredposition: 3
Nested viewport width.
height System.Double requiredposition: 4
Nested viewport height.
viewBoxWidth System.Double requiredposition: 5
Nested viewport local coordinate width.
viewBoxHeight System.Double requiredposition: 6
Nested viewport local coordinate height.
innerContent System.String requiredposition: 7
SVG content to place inside the nested viewport.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendNestedSvgEnd(StringBuilder builder) #
Returns: StringBuilder

Appends the end tag for a nested SVG viewport.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.

Returns

The supplied builder for call chaining.

AppendNestedSvgStart 2 overloads
public static StringBuilder AppendNestedSvgStart(StringBuilder builder, Double x, Double y, Double width, Double height) #
Returns: StringBuilder

Appends the start tag for a nested SVG viewport.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
x System.Double requiredposition: 1
Nested viewport x-coordinate.
y System.Double requiredposition: 2
Nested viewport y-coordinate.
width System.Double requiredposition: 3
Nested viewport width.
height System.Double requiredposition: 4
Nested viewport height.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendNestedSvgStart(StringBuilder builder, Double x, Double y, Double width, Double height, Double viewBoxWidth, Double viewBoxHeight) #
Returns: StringBuilder

Appends the start tag for a nested SVG viewport with an explicit local coordinate space.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
x System.Double requiredposition: 1
Nested viewport x-coordinate.
y System.Double requiredposition: 2
Nested viewport y-coordinate.
width System.Double requiredposition: 3
Nested viewport width.
height System.Double requiredposition: 4
Nested viewport height.
viewBoxWidth System.Double requiredposition: 5
Nested viewport local coordinate width.
viewBoxHeight System.Double requiredposition: 6
Nested viewport local coordinate height.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendNumberAttribute(StringBuilder builder, String attributeName, Double value) #
Returns: StringBuilder

Appends a numeric SVG attribute using shared invariant formatting.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
attributeName System.String requiredposition: 1
Attribute name.
value System.Double requiredposition: 2
Numeric attribute value.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendPaintAttribute(StringBuilder builder, String attributeName, OfficeColor color) #
Returns: StringBuilder

Appends an SVG paint attribute and matching opacity attribute when the color is transparent.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
attributeName System.String requiredposition: 1
Paint attribute name, such as fill or stroke.
color OfficeIMO.Drawing.OfficeColor requiredposition: 2
Office color.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendParallelLineElements(StringBuilder builder, Double x1, Double y1, Double x2, Double y2, OfficeColor stroke, Double strokeWidth, Double separation, OfficeStrokeDashStyle dashStyle = Solid, Nullable<OfficeStrokeLineCap> lineCap = null) #
Returns: StringBuilder

Appends two complete parallel SVG line elements using shared paint, dash, and cap formatting.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
x1 System.Double requiredposition: 1
Source line start X coordinate.
y1 System.Double requiredposition: 2
Source line start Y coordinate.
x2 System.Double requiredposition: 3
Source line end X coordinate.
y2 System.Double requiredposition: 4
Source line end Y coordinate.
stroke OfficeIMO.Drawing.OfficeColor requiredposition: 5
Stroke color.
strokeWidth System.Double requiredposition: 6
Stroke width.
separation System.Double requiredposition: 7
Distance between the two parallel line centers.
dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle = Solid optionalposition: 8
Stroke dash style.
lineCap System.Nullable{OfficeIMO.Drawing.OfficeStrokeLineCap} = null optionalposition: 9
Optional stroke line cap.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendPathData(StringBuilder builder, IReadOnlyList<OfficePathCommand> commands, Double offsetX = 0, Double offsetY = 0) #
Returns: StringBuilder

Appends SVG path data for shared Office path commands using invariant numeric formatting.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
commands System.Collections.Generic.IReadOnlyList{OfficeIMO.Drawing.OfficePathCommand} requiredposition: 1
Path commands to serialize.
offsetX System.Double = 0 optionalposition: 2
Additional x offset applied to command points.
offsetY System.Double = 0 optionalposition: 3
Additional y offset applied to command points.

Returns

The supplied builder for call chaining.

AppendPathElement 2 overloads
public static StringBuilder AppendPathElement(StringBuilder builder, String pathData, String attributes = null) #
Returns: StringBuilder

Appends a complete SVG path element using shared attribute escaping.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
pathData System.String requiredposition: 1
SVG path data.
attributes System.String = null optionalposition: 2
Optional already-formatted SVG attributes to append after the path data.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendPathElement(StringBuilder builder, IReadOnlyList<OfficePathCommand> commands, Double offsetX = 0, Double offsetY = 0, String attributes = null) #
Returns: StringBuilder

Appends a complete SVG path element from shared Office path commands.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
commands System.Collections.Generic.IReadOnlyList{OfficeIMO.Drawing.OfficePathCommand} requiredposition: 1
Path commands to serialize.
offsetX System.Double = 0 optionalposition: 2
Additional x offset applied to command points.
offsetY System.Double = 0 optionalposition: 3
Additional y offset applied to command points.
attributes System.String = null optionalposition: 4
Optional already-formatted SVG attributes to append after the path data.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendPointsAttribute(StringBuilder builder, IReadOnlyList<OfficePoint> points) #
Returns: StringBuilder

Appends an SVG points attribute for point-list based elements.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
points System.Collections.Generic.IReadOnlyList{OfficeIMO.Drawing.OfficePoint} requiredposition: 1
Point list.

Returns

The supplied builder for call chaining.

AppendPolygonElement 2 overloads
public static StringBuilder AppendPolygonElement(StringBuilder builder, IReadOnlyList<OfficePoint> points, String attributes = null) #
Returns: StringBuilder

Appends a complete SVG polygon element using shared point-list formatting.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
points System.Collections.Generic.IReadOnlyList{OfficeIMO.Drawing.OfficePoint} requiredposition: 1
Polygon points.
attributes System.String = null optionalposition: 2
Optional already-formatted SVG attributes to append after points.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendPolygonElement(StringBuilder builder, IReadOnlyList<OfficePoint> points, OfficeColor fill, Nullable<OfficeColor> stroke = null, Double strokeWidth = 0) #
Returns: StringBuilder

Appends a complete SVG polygon element with shared fill/stroke formatting.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
points System.Collections.Generic.IReadOnlyList{OfficeIMO.Drawing.OfficePoint} requiredposition: 1
Polygon points.
fill OfficeIMO.Drawing.OfficeColor requiredposition: 2
Polygon fill color.
stroke System.Nullable{OfficeIMO.Drawing.OfficeColor} = null optionalposition: 3
Optional polygon stroke color.
strokeWidth System.Double = 0 optionalposition: 4
Optional polygon stroke width.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendPolylineElement(StringBuilder builder, IReadOnlyList<OfficePoint> points, String attributes = null) #
Returns: StringBuilder

Appends a complete SVG polyline element using shared point-list formatting.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
points System.Collections.Generic.IReadOnlyList{OfficeIMO.Drawing.OfficePoint} requiredposition: 1
Polyline points.
attributes System.String = null optionalposition: 2
Optional already-formatted SVG attributes to append before points.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendRadialGradientDefinition(StringBuilder builder, String id, OfficeRadialGradient gradient) #
Returns: StringBuilder

Appends a reusable SVG radial-gradient definition.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
id System.String requiredposition: 1
Gradient identifier.
gradient OfficeIMO.Drawing.OfficeRadialGradient requiredposition: 2
Gradient definition.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendRectClipPathDefinition(StringBuilder builder, String clipPathId, Double x, Double y, Double width, Double height, Boolean wrapInDefs = false) #
Returns: StringBuilder

Appends an SVG rectangular clip path definition.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
clipPathId System.String requiredposition: 1
Clip path identifier.
x System.Double requiredposition: 2
Clip rectangle left coordinate.
y System.Double requiredposition: 3
Clip rectangle top coordinate.
width System.Double requiredposition: 4
Clip rectangle width.
height System.Double requiredposition: 5
Clip rectangle height.
wrapInDefs System.Boolean = false optionalposition: 6
When true, wraps the clip path in a defs element.

Returns

The supplied builder for call chaining.

AppendRectElement 2 overloads
public static StringBuilder AppendRectElement(StringBuilder builder, Double x, Double y, Double width, Double height, String attributes = null) #
Returns: StringBuilder

Appends a complete SVG rectangle element using shared numeric formatting.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
x System.Double requiredposition: 1
Rectangle x-coordinate.
y System.Double requiredposition: 2
Rectangle y-coordinate.
width System.Double requiredposition: 3
Rectangle width.
height System.Double requiredposition: 4
Rectangle height.
attributes System.String = null optionalposition: 5
Optional already-formatted SVG attributes to append after the geometry.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendRectElement(StringBuilder builder, Double x, Double y, Double width, Double height, Double rx, Double ry, String attributes = null) #
Returns: StringBuilder

Appends a complete SVG rounded rectangle element using shared numeric formatting.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
x System.Double requiredposition: 1
Rectangle x-coordinate.
y System.Double requiredposition: 2
Rectangle y-coordinate.
width System.Double requiredposition: 3
Rectangle width.
height System.Double requiredposition: 4
Rectangle height.
rx System.Double requiredposition: 5
Horizontal corner radius.
ry System.Double requiredposition: 6
Vertical corner radius.
attributes System.String = null optionalposition: 7
Optional already-formatted SVG attributes to append after the geometry.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendRotateTransformAttribute(StringBuilder builder, Double degrees, Double centerX, Double centerY) #
Returns: StringBuilder

Appends an SVG rotate transform attribute using shared invariant numeric formatting.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
degrees System.Double requiredposition: 1
Rotation angle in degrees.
centerX System.Double requiredposition: 2
Rotation center x-coordinate.
centerY System.Double requiredposition: 3
Rotation center y-coordinate.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendStrokeDashArrayAttribute(StringBuilder builder, String dashArray) #
Returns: StringBuilder

Appends an SVG stroke-dasharray attribute when a dash pattern is present.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
dashArray System.String requiredposition: 1
SVG dash-array value, or null for solid strokes.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendStrokeDashStyleAttribute(StringBuilder builder, OfficeStrokeDashStyle dashStyle, Double strokeWidth) #
Returns: StringBuilder

Appends an SVG stroke-dasharray attribute for a shared Office stroke dash style.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle requiredposition: 1
Office stroke dash style.
strokeWidth System.Double requiredposition: 2
Rendered stroke width.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendStrokeLineCapAttribute(StringBuilder builder, OfficeStrokeLineCap cap) #
Returns: StringBuilder

Appends an SVG stroke-linecap attribute.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
cap OfficeIMO.Drawing.OfficeStrokeLineCap requiredposition: 1
Stroke line cap.

Returns

The supplied builder for call chaining.

public static StringBuilder AppendStrokeLineJoinAttribute(StringBuilder builder, OfficeStrokeLineJoin join) #
Returns: StringBuilder

Appends an SVG stroke-linejoin attribute.

Parameters

builder System.Text.StringBuilder requiredposition: 0
Markup builder.
join OfficeIMO.Drawing.OfficeStrokeLineJoin requiredposition: 1
Stroke line join.

Returns

The supplied builder for call chaining.

public static String Escape(String value) #
Returns: String

Escapes text for XML/SVG attribute or element content.

Parameters

value System.String requiredposition: 0
Text to escape.

Returns

Escaped text, or an empty string for null.

public static String ExtractSvgInner(String svg) #
Returns: String

Extracts the content inside an SVG root element.

Parameters

svg System.String requiredposition: 0
SVG markup, or already-inner SVG content.

Returns

Inner SVG markup when a root SVG element is found; otherwise the original value.

public static String FormatImageFrameTransform(OfficeImageFrameTransform transform) #
Returns: String

Formats an SVG image frame transform using shared projection rotation and mirror semantics.

Parameters

transform OfficeIMO.Drawing.OfficeImageFrameTransform requiredposition: 0
Image frame transform.

Returns

SVG transform value, or null when the frame transform is identity.

public static String FormatMatrixTransform(OfficeTransform transform, Double placementX = 0, Double placementY = 0) #
Returns: String

Formats an SVG matrix transform using shared invariant numeric formatting.

Parameters

transform OfficeIMO.Drawing.OfficeTransform requiredposition: 0
Affine transform matrix.
placementX System.Double = 0 optionalposition: 1
Additional x placement offset applied to the transform.
placementY System.Double = 0 optionalposition: 2
Additional y placement offset applied to the transform.

Returns

SVG matrix transform value.

public static String FormatMoveLinePathData(IReadOnlyList<OfficePoint> points, Boolean closePath = false) #
Returns: String

Formats SVG path data for a move/line polyline or polygon using shared invariant numeric formatting.

Parameters

points System.Collections.Generic.IReadOnlyList{OfficeIMO.Drawing.OfficePoint} requiredposition: 0
Points to serialize.
closePath System.Boolean = false optionalposition: 1
When true, appends a close-path command after at least one point.

Returns

SVG path data, or an empty string when no points are supplied.

public static String FormatNumber(Double value) #
Returns: String

Formats a numeric SVG attribute value using invariant culture and compact precision.

Parameters

value System.Double requiredposition: 0
Numeric value to format.

Returns

Formatted SVG number.

public static String FormatPathData(IReadOnlyList<OfficePathCommand> commands, Double offsetX = 0, Double offsetY = 0) #
Returns: String

Formats SVG path data for shared Office path commands using invariant numeric formatting.

Parameters

commands System.Collections.Generic.IReadOnlyList{OfficeIMO.Drawing.OfficePathCommand} requiredposition: 0
Path commands to serialize.
offsetX System.Double = 0 optionalposition: 1
Additional x offset applied to command points.
offsetY System.Double = 0 optionalposition: 2
Additional y offset applied to command points.

Returns

SVG path data, or an empty string when no commands are supplied.

FormatRotateTransform 2 overloads
public static String FormatRotateTransform(Double degrees, Double centerX, Double centerY) #
Returns: String

Formats an SVG rotate transform using shared invariant numeric formatting.

Parameters

degrees System.Double requiredposition: 0
Rotation angle in degrees.
centerX System.Double requiredposition: 1
Rotation center x-coordinate.
centerY System.Double requiredposition: 2
Rotation center y-coordinate.

Returns

SVG rotate transform value.

public static String FormatRotateTransform(Double degrees) #
Returns: String

Formats an SVG rotate transform around the current transform origin using shared invariant numeric formatting.

Parameters

degrees System.Double requiredposition: 0
Rotation angle in degrees.

Returns

SVG rotate transform value.

public static String FormatStrokeLineCap(OfficeStrokeLineCap cap) #
Returns: String

Converts a stroke line cap value to an SVG attribute value.

Parameters

cap OfficeIMO.Drawing.OfficeStrokeLineCap requiredposition: 0
Stroke line cap.

Returns

SVG stroke-linecap value.

public static String FormatStrokeLineJoin(OfficeStrokeLineJoin join) #
Returns: String

Converts a stroke line join value to an SVG attribute value.

Parameters

join OfficeIMO.Drawing.OfficeStrokeLineJoin requiredposition: 0
Stroke line join.

Returns

SVG stroke-linejoin value.

public static String ToCssColor(OfficeColor color) #
Returns: String

Converts an Office color to a CSS RGB hex color for SVG paint attributes.

Parameters

color OfficeIMO.Drawing.OfficeColor requiredposition: 0
Office color.

Returns

CSS color in #RRGGBB form.

public static Double ToOpacity(OfficeColor color) #
Returns: Double

Converts an Office color alpha channel to an SVG opacity value.

Parameters

color OfficeIMO.Drawing.OfficeColor requiredposition: 0
Office color.

Returns

Opacity between 0 and 1.

public static Void WriteColorAttribute(XmlWriter writer, String attributeName, OfficeColor color) #
Returns: Void

Writes an SVG color attribute and matching opacity attribute when transparency is present.

Parameters

writer System.Xml.XmlWriter requiredposition: 0
XML writer receiving SVG attributes.
attributeName System.String requiredposition: 1
SVG paint attribute name, such as fill or stroke.
color OfficeIMO.Drawing.OfficeColor requiredposition: 2
Office color.
public static Void WriteNumberAttribute(XmlWriter writer, String attributeName, Double value) #
Returns: Void

Writes a numeric SVG attribute using shared invariant formatting.

Parameters

writer System.Xml.XmlWriter requiredposition: 0
XML writer receiving the attribute.
attributeName System.String requiredposition: 1
Attribute name.
value System.Double requiredposition: 2
Numeric attribute value.
public static Void WriteRotateTransformAttribute(XmlWriter writer, Double degrees, Double centerX, Double centerY) #
Returns: Void

Writes an SVG rotate transform attribute using shared invariant numeric formatting.

Parameters

writer System.Xml.XmlWriter requiredposition: 0
XML writer receiving the attribute.
degrees System.Double requiredposition: 1
Rotation angle in degrees.
centerX System.Double requiredposition: 2
Rotation center x-coordinate.
centerY System.Double requiredposition: 3
Rotation center y-coordinate.
public static Void WriteStrokeDashArrayAttribute(XmlWriter writer, String dashArray) #
Returns: Void

Writes an SVG stroke-dasharray attribute when a dash pattern is present.

Parameters

writer System.Xml.XmlWriter requiredposition: 0
XML writer receiving the attribute.
dashArray System.String requiredposition: 1
SVG dash-array value, or null for solid strokes.
public static Void WriteStrokeDashStyleAttribute(XmlWriter writer, OfficeStrokeDashStyle dashStyle, Double strokeWidth) #
Returns: Void

Writes an SVG stroke-dasharray attribute for a shared Office stroke dash style.

Parameters

writer System.Xml.XmlWriter requiredposition: 0
XML writer receiving the attribute.
dashStyle OfficeIMO.Drawing.OfficeStrokeDashStyle requiredposition: 1
Office stroke dash style.
strokeWidth System.Double requiredposition: 2
Rendered stroke width.
public static Void WriteStrokeLineCapAttribute(XmlWriter writer, OfficeStrokeLineCap cap) #
Returns: Void

Writes an SVG stroke-linecap attribute.

Parameters

writer System.Xml.XmlWriter requiredposition: 0
XML writer receiving the attribute.
cap OfficeIMO.Drawing.OfficeStrokeLineCap requiredposition: 1
Stroke line cap.
public static Void WriteStrokeLineJoinAttribute(XmlWriter writer, OfficeStrokeLineJoin join) #
Returns: Void

Writes an SVG stroke-linejoin attribute.

Parameters

writer System.Xml.XmlWriter requiredposition: 0
XML writer receiving the attribute.
join OfficeIMO.Drawing.OfficeStrokeLineJoin requiredposition: 1
Stroke line join.
public static Void WriteViewBoxAttribute(XmlWriter writer, Double minX, Double minY, Double width, Double height) #
Returns: Void

Writes an SVG viewBox attribute using shared invariant numeric formatting.

Parameters

writer System.Xml.XmlWriter requiredposition: 0
XML writer receiving the attribute.
minX System.Double requiredposition: 1
Minimum x-coordinate.
minY System.Double requiredposition: 2
Minimum y-coordinate.
width System.Double requiredposition: 3
ViewBox width.
height System.Double requiredposition: 4
ViewBox height.