SvgSpriteBuilderAddSymbol Method
Adds an SVG document as a symbol to current SVG document.
Namespace: DotMake.SvgSpriteAssembly: DotMake.SvgSprite (in DotMake.SvgSprite.dll) Version: 1.0.0
public XElement AddSymbol(
SvgDocument svgDocument,
string symbolId = null,
SvgSymbolOptions svgSymbolOptions = null
)
- svgDocument SvgDocument
- The input SVG document to add as a symbol.
- symbolId String (Optional)
-
The symbol id. If not specified, existing id attribute will be used. If no existing id attribute, IdForMissing will be used.
The resulting id will be prefixed with IdPrefix if it was set.
The resulting id will be converted to lowercase if IdLowerCased was set.
When there are duplicates, the id will be incremented like "symbol-2", "symbol-3" etc.
The disallowed characters will be replaced with IdReplacementChar if it was set.
SVG uses XML rules for id attributes, so the allowed characters are:
-
Start Character
- Must begin with a letter (A–Z, a–z) or underscore (_)
- Cannot start with a number or hyphen (-)
-
Subsequent Characters
- Letters (A–Z, a–z)
- Digits (0–9)
- Underscore (_)
- Hyphen (-)
- Period (.)
- svgSymbolOptions SvgSymbolOptions (Optional)
- The options to use when converting an <svg> tag to an <symbol> tag or vice versa.
XElementA
XElement for the added
<symbol> tag.