Click or drag to resize
AB4D logo

ReaderSvgGetElementSvgText Method

GetElementSvgText can be called after the svg file has been read. It returns svg text of the element with with the specified elementName and elementNameType. If the element is not found, null is returned.

Namespace:  Ab2d
Assembly:  Ab2d.ReaderSvg (in Ab2d.ReaderSvg.dll) Version: 7.1.7295.1040
Syntax
C#
public string GetElementSvgText(
	string elementName,
	ReaderSvgNamedObjectsSourceType elementNameType = ReaderSvgNamedObjectsSourceType.Auto
)

Parameters

elementName
Type: SystemString
name of the svg element
elementNameType (Optional)
Type: Ab2dReaderSvgNamedObjectsSourceType
elementNameType specifies the what element or attribute in svg file defines the element name

Return Value

Type: String
svg text of the element with elementName or null if not found
Remarks

GetElementSvgText returns svg text of the element with with the specified elementName. If the element is not found, null is returned. The method can be called after the svg file has been read.

Elements in svg file can use different attributes or inner elements to define their names. Usually id attribute is used for that. But some files (for example files from Visio) define title element for naming. Files created in Inkscape also define inkscape:label attribute that can also be used for naming.

To specify which attribute or element to use for naming the elementNameType parameter is used. By default it is set to Auto. This means that the same naming specification used to read the current svg file is used - defined by the NamedObjectsSource property. Other values specify other way to get the name.

See Also