Search Results for

    Show / Hide Table of Contents

    ExcelFile.RenderObjectAsSVG Method

    Overloads

    • ExcelFile.RenderObjectAsSVG(Int32, String, String, Encoding)
    • ExcelFile.RenderObjectAsSVG(Stream, Int32, String, String, Encoding)
    • ExcelFile.RenderObjectAsSVG(Int32, String, String, String, Encoding)
    • ExcelFile.RenderObjectAsSVG(Stream, Int32, String, String, String, Encoding)
    • ExcelFile.RenderObjectAsSVG(Int32, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)
    • ExcelFile.RenderObjectAsSVG(Stream, Int32, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)
    • ExcelFile.RenderObjectAsSVG(Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)
    • ExcelFile.RenderObjectAsSVG(Stream, Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)
    • ExcelFile.RenderObjectAsSVG(Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle)
    • ExcelFile.RenderObjectAsSVG(Stream, Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle)

    ExcelFile.RenderObjectAsSVG(Int32, String, String, Encoding)

    This method renders any object (chart, image, autoshape, etc) into an SVG image, and returns the XML for the image.

    Syntax

    Namespace: FlexCel.Core

    public String RenderObjectAsSVG(Int32 objectIndex, String title, String description, Encoding encoding)

    Parameters

    <-> Parameter Type Description
    objectIndex Int32 Index of the object (1 based).
    title String Title for the image. It will be saved inside the SVG file.
    description String Description for the image. It will be saved inside the SVG file.
    encoding Encoding Encoding that will be declared for the xml file if ExportType is all.
    Note that the result string will always be UTF16 encoded, but if you want to save it to an UTF8 file, you will have to set encoding = utf8. Also note that this parameter is only used if the ExportType parameter is All.
    It only affects the xml declaration.
    If null, utf-8 will be used.

    Returns

    Might return null if the image is not visible.

    See also

    • ExcelFile

    ExcelFile.RenderObjectAsSVG(Stream, Int32, String, String, Encoding)

    This method saves any object (chart, image, autoshape, etc) into an SVG image inside a stream.

    Syntax

    Namespace: FlexCel.Core

    public void RenderObjectAsSVG(Stream resultStream, Int32 objectIndex, String title, String description, Encoding encoding)

    Parameters

    <-> Parameter Type Description
    resultStream Stream Stream where the file will be saved.
    objectIndex Int32 Index of the object (1 based).
    title String Title for the image. It will be saved inside the SVG file.
    description String Description for the image. It will be saved inside the SVG file.
    encoding Encoding Encoding that will be used for the xml.
    If null, utf-8 will be used.

    See also

    • ExcelFile

    ExcelFile.RenderObjectAsSVG(Int32, String, String, String, Encoding)

    This method renders any object (chart, image, autoshape, etc) into an SVG image, and returns the XML for the image.

    Remarks

    This method sets some values in other overloads of RenderObjectasSVG to their defaults. If you need more control over the parameters passed to RenderObjectAsSVG, you can use any overload which takes a TShapeProperties parameter, and pass a shapeProperties from the object you want to render. While those overloads take an objectIndex and no objectPath, what is used for rendering is the shapeProperties. The objectIndex is only used to determine the position of the object in the z axis.

    Syntax

    Namespace: FlexCel.Core

    public String RenderObjectAsSVG(Int32 objectIndex, String objectPath, String title, String description, Encoding encoding)

    Parameters

    <-> Parameter Type Description
    objectIndex Int32 Index of the object (1 based).
    objectPath String Path to the object ot render. Look at GetObjectProperties(Int32, String, Boolean) for a description of the possible values.
    title String Title for the image. It will be saved inside the SVG file.
    description String Description for the image. It will be saved inside the SVG file.
    encoding Encoding Encoding that will be declared for the xml file if ExportType is all.
    Note that the result string will always be UTF16 encoded, but if you want to save it to an UTF8 file, you will have to set encoding = utf8. Also note that this parameter is only used if the ExportType parameter is All.
    It only affects the xml declaration.
    If null, utf-8 will be used.

    Returns

    Might return null if the image is not visible.

    Examples

    To save the image of a chart named "my_pie_chart" to disk as an SVG image, you can use the code:

        var svg = xls.RenderObjectAsSVG(-1, "@my_pie_chart", "This is a chart", "This chart was rendered with RenderObjectAsSVG", Encoding.UTF8);
        {
            File.WriteAllText("myfilename.svg", svg);
        }
    

    See also

    • ExcelFile

    ExcelFile.RenderObjectAsSVG(Stream, Int32, String, String, String, Encoding)

    This method saves any object (chart, image, autoshape, etc) into an SVG image inside a stream.

    Remarks

    This method sets some values in other overloads of RenderObjectasSVG to their defaults. If you need more control over the parameters passed to RenderObjectAsSVG, you can use any overload which takes a TShapeProperties parameter, and pass a shapeProperties from the object you want to render. While those overloads take an objectIndex and no objectPath, what is used for rendering is the shapeProperties. The objectIndex is only used to determine the position of the object in the z axis.

    Syntax

    Namespace: FlexCel.Core

    public void RenderObjectAsSVG(Stream resultStream, Int32 objectIndex, String objectPath, String title, String description, Encoding encoding)

    Parameters

    <-> Parameter Type Description
    resultStream Stream Stream where the file will be saved.
    objectIndex Int32 Index of the object (1 based).
    objectPath String Path to the object to render. Look at GetObjectProperties(Int32, String, Boolean) for a description of the possible values.
    title String Title for the image. It will be saved inside the SVG file.
    description String Description for the image. It will be saved inside the SVG file.
    encoding Encoding Encoding that will be used for the xml.
    If null, utf-8 will be used.

    Examples

    To save the image of a chart named "my_pie_chart" to disk as an SVG image, you can use the code:

        using (FileStream SvgStream = new FileStream("myfilename.svg", FileMode.Create))
        {
            xls.RenderObjectAsSVG(SvgStream, -1, "@my_pie_chart", "This is a chart", "This chart was rendered with RenderObjectAsSVG", Encoding.UTF8);
        }
    

    See also

    • ExcelFile

    ExcelFile.RenderObjectAsSVG(Int32, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)

    This method renders any object (chart, image, autoshape, etc) into an SVG image, and returns the XML for the image.

    Syntax

    Namespace: FlexCel.Core

    public String RenderObjectAsSVG(Int32 objectIndex, TShapeProperties shapeProperties, TUIColor BackgroundColor, TSVGExportType exportType, String idPrefix, String title, String description, IEnumerable<TSVGAttribute> extraSVGAttributes, Encoding encoding, out TPointF origin, out TUIRectangle imageDimensions)

    Parameters

    <-> Parameter Type Description
    objectIndex Int32 Index of the object (1 based).

    Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
    shapeProperties TShapeProperties Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
    BackgroundColor TUIColor Color for the background of the image. For a transparent background, use TUIColor.Empty.
    exportType TSVGExportType How much of the SVG will be exported.
    idPrefix String Prefix to be used in all definitions inside the svg file. For normal SVG files you can leave this null, but if you are embedding the files inside an html file, you need to ensure every image has unique identifiers.
    All SVG identifiers from different images inside an html file must be unique.
    title String Title for the image. It will be saved inside the SVG file.
    description String Description for the image. It will be saved inside the SVG file.
    extraSVGAttributes IEnumerable<TSVGAttribute> Extra attributes to be added to the svg tag.
    encoding Encoding Encoding that will be declared for the xml file if exportType is All.
    Note that the result string will always be UTF16 encoded, but if you want to save it to an UTF8 file, you will have to set encoding = utf8. Also note that this parameter is only used if the exportType parameter is All.
    It only affects the xml declaration.
    If null, utf-8 will be used.
    out origin TPointF Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
    out imageDimensions TUIRectangle Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image.

    Returns

    Might return null if the image is not visible.

    See also

    • ExcelFile

    ExcelFile.RenderObjectAsSVG(Stream, Int32, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)

    This method saves any object (chart, image, autoshape, etc) into an SVG image inside a stream.

    Syntax

    Namespace: FlexCel.Core

    public void RenderObjectAsSVG(Stream resultStream, Int32 objectIndex, TShapeProperties shapeProperties, TUIColor BackgroundColor, TSVGExportType exportType, String idPrefix, String title, String description, IEnumerable<TSVGAttribute> extraSVGAttributes, Encoding encoding, out TPointF origin, out TUIRectangle imageDimensions)

    Parameters

    <-> Parameter Type Description
    resultStream Stream Stream where the data will be saved.
    objectIndex Int32 Index of the object (1 based).

    Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
    shapeProperties TShapeProperties Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
    BackgroundColor TUIColor Color for the background of the image. For a transparent background, use TUIColor.Empty.
    exportType TSVGExportType How much of the SVG will be exported.
    idPrefix String Prefix to be used in all definitions inside the svg file. For normal SVG files you can leave this null, but if you are embedding the files inside an html file, you need to ensure every image has unique identifiers.
    All SVG identifiers from different images inside an html file must be unique.
    title String Title for the image. It will be saved inside the SVG file.
    description String Description for the image. It will be saved inside the SVG file.
    extraSVGAttributes IEnumerable<TSVGAttribute> Extra attributes to be added to the svg tag.
    encoding Encoding Encoding that will be used for the xml.
    If null, utf-8 will be used.
    out origin TPointF Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
    out imageDimensions TUIRectangle Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image.

    See also

    • ExcelFile

    ExcelFile.RenderObjectAsSVG(Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)

    This method renders any object (chart, image, autoshape, etc) into an SVG image, and returns the XML for the image.

    Syntax

    Namespace: FlexCel.Core

    public String RenderObjectAsSVG(Int32 objectIndex, Double aPageScale, TShapeProperties shapeProperties, TUIColor BackgroundColor, TSVGExportType exportType, String idPrefix, String title, String description, IEnumerable<TSVGAttribute> extraSVGAttributes, Encoding encoding, out TPointF origin, out TUIRectangle imageDimensions)

    Parameters

    <-> Parameter Type Description
    objectIndex Int32 Index of the object (1 based).

    Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
    aPageScale Double Page scale. Use 1 for 100%
    shapeProperties TShapeProperties Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
    BackgroundColor TUIColor Color for the background of the image. For a transparent background, use TUIColor.Empty.
    exportType TSVGExportType How much of the SVG will be exported.
    idPrefix String Prefix to be used in all definitions inside the svg file. For normal SVG files you can leave this null, but if you are embedding the files inside an html file, you need to ensure every image has unique identifiers.
    All SVG identifiers from different images inside an html file must be unique.
    title String Title for the image. It will be saved inside the SVG file.
    description String Description for the image. It will be saved inside the SVG file.
    extraSVGAttributes IEnumerable<TSVGAttribute> Extra attributes to be added to the svg tag.
    encoding Encoding Encoding that will be declared for the xml file if exportType is All.
    Note that the result string will always be UTF16 encoded, but if you want to save it to an UTF8 file, you will have to set encoding = utf8. Also note that this parameter is only used if the exportType parameter is All.
    It only affects the xml declaration.
    If null, utf-8 will be used.
    out origin TPointF Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
    out imageDimensions TUIRectangle Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image.

    Returns

    Might return null if the image is not visible.

    See also

    • ExcelFile

    ExcelFile.RenderObjectAsSVG(Stream, Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, TPointF, TUIRectangle)

    This method saves any object (chart, image, autoshape, etc) into an SVG image inside a stream.

    Syntax

    Namespace: FlexCel.Core

    public void RenderObjectAsSVG(Stream resultStream, Int32 objectIndex, Double aPageScale, TShapeProperties shapeProperties, TUIColor BackgroundColor, TSVGExportType exportType, String idPrefix, String title, String description, IEnumerable<TSVGAttribute> extraSVGAttributes, Encoding encoding, out TPointF origin, out TUIRectangle imageDimensions)

    Parameters

    <-> Parameter Type Description
    resultStream Stream Stream where the data will be saved.
    objectIndex Int32 Index of the object (1 based).

    Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
    aPageScale Double Page scale. Use 1 for 100%
    shapeProperties TShapeProperties Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
    BackgroundColor TUIColor Color for the background of the image. For a transparent background, use TUIColor.Empty.
    exportType TSVGExportType How much of the SVG will be exported.
    idPrefix String Prefix to be used in all definitions inside the svg file. For normal SVG files you can leave this null, but if you are embedding the files inside an html file, you need to ensure every image has unique identifiers.
    All SVG identifiers from different images inside an html file must be unique.
    title String Title for the image. It will be saved inside the SVG file.
    description String Description for the image. It will be saved inside the SVG file.
    extraSVGAttributes IEnumerable<TSVGAttribute> Extra attributes to be added to the svg tag.
    encoding Encoding Encoding that will be used for the xml.
    If null, utf-8 will be used.
    out origin TPointF Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
    out imageDimensions TUIRectangle Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image.

    See also

    • ExcelFile

    ExcelFile.RenderObjectAsSVG(Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle)

    This method renders any object (chart, image, autoshape, etc) into an SVG image, and returns the XML for the image.

    Syntax

    Namespace: FlexCel.Core

    public abstract String RenderObjectAsSVG(Int32 objectIndex, Double aPageScale, TShapeProperties shapeProperties, TUIColor BackgroundColor, TSVGExportType exportType, String idPrefix, String title, String description, IEnumerable<TSVGAttribute> extraSVGAttributes, Encoding encoding, Boolean rasterizeSVGImages, out TPointF origin, out TUIRectangle imageDimensions)

    Parameters

    <-> Parameter Type Description
    objectIndex Int32 Index of the object (1 based).

    Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
    aPageScale Double Page scale. Use 1 for 100%
    shapeProperties TShapeProperties Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
    BackgroundColor TUIColor Color for the background of the image. For a transparent background, use TUIColor.Empty.
    exportType TSVGExportType How much of the SVG will be exported.
    idPrefix String Prefix to be used in all definitions inside the svg file. For normal SVG files you can leave this null, but if you are embedding the files inside an html file, you need to ensure every image has unique identifiers.
    All SVG identifiers from different images inside an html file must be unique.
    title String Title for the image. It will be saved inside the SVG file.
    description String Description for the image. It will be saved inside the SVG file.
    extraSVGAttributes IEnumerable<TSVGAttribute> Extra attributes to be added to the svg tag.
    encoding Encoding Encoding that will be declared for the xml file if exportType is All.
    Note that the result string will always be UTF16 encoded, but if you want to save it to an UTF8 file, you will have to set encoding = utf8. Also note that this parameter is only used if the exportType parameter is All.
    It only affects the xml declaration.
    If null, utf-8 will be used.
    rasterizeSVGImages Boolean If true, FlexCel will rasterize all SVG images in the Excel file to png before exporting them.
    See S V G Files Inside Xlsx Files for more information.
    out origin TPointF Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
    out imageDimensions TUIRectangle Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image.

    Returns

    Might return null if the image is not visible.

    See also

    • ExcelFile

    ExcelFile.RenderObjectAsSVG(Stream, Int32, Double, TShapeProperties, TUIColor, TSVGExportType, String, String, String, IEnumerable<TSVGAttribute>, Encoding, Boolean, TPointF, TUIRectangle)

    This method saves any object (chart, image, autoshape, etc) into an SVG image inside a stream.

    Syntax

    Namespace: FlexCel.Core

    public abstract void RenderObjectAsSVG(Stream resultStream, Int32 objectIndex, Double aPageScale, TShapeProperties shapeProperties, TUIColor BackgroundColor, TSVGExportType exportType, String idPrefix, String title, String description, IEnumerable<TSVGAttribute> extraSVGAttributes, Encoding encoding, Boolean rasterizeSVGImages, out TPointF origin, out TUIRectangle imageDimensions)

    Parameters

    <-> Parameter Type Description
    resultStream Stream Stream where the data will be saved.
    objectIndex Int32 Index of the object (1 based).

    Note: This object index is not used to get the object to render, which is given by the shapeProperties parameter. The object index is only used to determine the z-order of the object. If shapeProperties refers to a grouped object, pass the object index of the main group here.
    aPageScale Double Page scale. Use 1 for 100%
    shapeProperties TShapeProperties Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Int32, Boolean).
    BackgroundColor TUIColor Color for the background of the image. For a transparent background, use TUIColor.Empty.
    exportType TSVGExportType How much of the SVG will be exported.
    idPrefix String Prefix to be used in all definitions inside the svg file. For normal SVG files you can leave this null, but if you are embedding the files inside an html file, you need to ensure every image has unique identifiers.
    All SVG identifiers from different images inside an html file must be unique.
    title String Title for the image. It will be saved inside the SVG file.
    description String Description for the image. It will be saved inside the SVG file.
    extraSVGAttributes IEnumerable<TSVGAttribute> Extra attributes to be added to the svg tag.
    encoding Encoding Encoding that will be used for the xml.
    If null, utf-8 will be used.
    rasterizeSVGImages Boolean If true, FlexCel will rasterize all SVG images in the Excel file to png before exporting them.
    See S V G Files Inside Xlsx Files for more information.
    out origin TPointF Top-left coordinates of the image in points. While this is normally the same as the image coordinates you get in the properties, if there is a shadow to the right or to the top it might change. Use it to properly position the image where you want it.
    out imageDimensions TUIRectangle Returns the image dimension of the rendered object in points. Note that this can be different from the image size reported by GetImageProperties(Int32) because shadows or rotation of the image.

    See also

    • ExcelFile
    In This Article
    Back to top FlexCel Studio for the .NET Framework v7.24.0.0
    © 2002 - 2025 tmssoftware.com