Search Results for

    Show / Hide Table of Contents

    XlsFile.RenderObjectAsSVG Method

    Overloads

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

    XlsFile.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.XlsAdapter

    public override 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 ExcelFile.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 ExcelFile.GetImageProperties(Int32) because shadows or rotation of the image.

    Returns

    Might return null if the image is not visible.

    See also

    • XlsFile

    XlsFile.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.XlsAdapter

    public override 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 ExcelFile.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 ExcelFile.GetImageProperties(Int32) because shadows or rotation of the image.

    See also

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