SvgDocument Class
Represents an SVG document. Provides methods for loading, editing and saving SVG files.
Namespace: DotMake.SvgSpriteAssembly: DotMake.SvgSprite (in DotMake.SvgSprite.dll) Version: 1.0.0
- Inheritance
- Object SvgDocument
SvgDocument svgDocument;
//Create an empty SVG document
svgDocument = new SvgDocument();
//Load an SVG document from a file
svgDocument = new SvgDocument("SomeFile.svg");
//Load an SVG document from a stream
svgDocument = new SvgDocument(stream);
//Load an SVG document from a text reader
svgDocument = new SvgDocument(textReader);
//Load an SVG document from a xml reader
svgDocument = new SvgDocument(xmlReader);
//Load an SVG document from a string
svgDocument = SvgDocument.Parse(svgString);
//Saves this SVG to a file
svgDocument.Save("SomeFile.svg");
//Save minified
svgDocument.Save("SomeFile.svg", true);
//Saves this SVG to a stream
svgDocument.Save(stream);
//Save minified
svgDocument.Save(stream, true);
//Saves this SVG to a text writer
svgDocument.Save(textWriter);
//Save minified
svgDocument.Save(textWriter, true);
//Saves this SVG to a xml writer
svgDocument.Save(xmlWriter);
//Save minified
svgDocument.Save(xmlWriter, true);
//Saves this SVG to a string
svgString = svgDocument.ToString();
//Save minified
svgString = svgDocument.ToString(true);
Root |
Gets the root element of this SVG document, i.e. the <svg> tag.
|
Namespace |
Gets the namespace for SVG documents, i.e. http://www.w3.org/2000/svg.
|