Search Results for

    Show / Hide Table of Contents

    TExcelFile.RenderObjectAsSVG Method

    Overloads

    • TExcelFile.RenderObjectAsSVG(Integer, string, string, TEncoding)
    • TExcelFile.RenderObjectAsSVG(TStream, Integer, string, string, TEncoding)
    • TExcelFile.RenderObjectAsSVG(Integer, string, string, string, TEncoding)
    • TExcelFile.RenderObjectAsSVG(TStream, Integer, string, string, string, TEncoding)
    • TExcelFile.RenderObjectAsSVG(Integer, IShapeProperties, TUIColor, TSVGExportType, string, string, string, TArray<TSVGAttribute>, TEncoding, TUIPointF, TUIRectangle)
    • TExcelFile.RenderObjectAsSVG(TStream, Integer, IShapeProperties, TUIColor, TSVGExportType, string, string, string, TArray<TSVGAttribute>, TEncoding, TUIPointF, TUIRectangle)
    • TExcelFile.RenderObjectAsSVG(Integer, Double, IShapeProperties, TUIColor, TSVGExportType, string, string, string, TArray<TSVGAttribute>, TEncoding, TUIPointF, TUIRectangle)
    • TExcelFile.RenderObjectAsSVG(TStream, Integer, Double, IShapeProperties, TUIColor, TSVGExportType, string, string, string, TArray<TSVGAttribute>, TEncoding, TUIPointF, TUIRectangle)
    • TExcelFile.RenderObjectAsSVG(Integer, Double, IShapeProperties, TUIColor, TSVGExportType, string, string, string, TArray<TSVGAttribute>, TEncoding, Boolean, TUIPointF, TUIRectangle)
    • TExcelFile.RenderObjectAsSVG(TStream, Integer, Double, IShapeProperties, TUIColor, TSVGExportType, string, string, string, TArray<TSVGAttribute>, TEncoding, Boolean, TUIPointF, TUIRectangle)

    TExcelFile.RenderObjectAsSVG(Integer, string, string, TEncoding)

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

    Syntax

    Unit: FlexCel.Core

    function TExcelFile.RenderObjectAsSVG(const objectIndex: Integer; const title: string; const description: string; const encoding: TEncoding): string; overload;

    Parameters

    <-> Parameter Type Description
    const objectIndex Integer Index of the object (1 based).
    const title string Title for the image. It will be saved inside the SVG file.
    const description string Description for the image. It will be saved inside the SVG file.
    const encoding TEncoding 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

    • TExcelFile

    TExcelFile.RenderObjectAsSVG(TStream, Integer, string, string, TEncoding)

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

    Syntax

    Unit: FlexCel.Core

    procedure TExcelFile.RenderObjectAsSVG(const resultStream: TStream; const objectIndex: Integer; const title: string; const description: string; const encoding: TEncoding); overload;

    Parameters

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

    See also

    • TExcelFile

    TExcelFile.RenderObjectAsSVG(Integer, string, string, string, TEncoding)

    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 IShapeProperties 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

    Unit: FlexCel.Core

    function TExcelFile.RenderObjectAsSVG(const objectIndex: Integer; const objectPath: string; const title: string; const description: string; const encoding: TEncoding): string; overload;

    Parameters

    <-> Parameter Type Description
    const objectIndex Integer Index of the object (1 based).
    const objectPath string Path to the object ot render. Look at GetObjectProperties(Integer, string, Boolean) for a description of the possible values.
    const title string Title for the image. It will be saved inside the SVG file.
    const description string Description for the image. It will be saved inside the SVG file.
    const encoding TEncoding 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: String;
    ...
      svg := xls.RenderObjectAsSVG(-1, '@my_pie_chart', 'This is a chart', 'This chart was rendered with RenderObjectAsSVG', TEncoding.UTF8);
      begin
        TFile.WriteAllText('myfilename.svg', svg);
      end;
    

    See also

    • TExcelFile

    TExcelFile.RenderObjectAsSVG(TStream, Integer, string, string, string, TEncoding)

    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 IShapeProperties 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

    Unit: FlexCel.Core

    procedure TExcelFile.RenderObjectAsSVG(const resultStream: TStream; const objectIndex: Integer; const objectPath: string; const title: string; const description: string; const encoding: TEncoding); overload;

    Parameters

    <-> Parameter Type Description
    const resultStream TStream Stream where the file will be saved.
    const objectIndex Integer Index of the object (1 based).
    const objectPath string Path to the object to render. Look at GetObjectProperties(Integer, string, Boolean) for a description of the possible values.
    const title string Title for the image. It will be saved inside the SVG file.
    const description string Description for the image. It will be saved inside the SVG file.
    const encoding TEncoding 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:

    var
      SvgStream: TFileStream;
    ...
      SvgStream := TFileStream.Create('myfilename.svg', fmCreate);
      try
        xls.RenderObjectAsSVG(SvgStream, -1, '@my_pie_chart', 'This is a chart', 'This chart was rendered with RenderObjectAsSVG', TEncoding.UTF8);
      finally
        SvgStream.Free;
      end;
    

    See also

    • TExcelFile

    TExcelFile.RenderObjectAsSVG(Integer, IShapeProperties, TUIColor, TSVGExportType, string, string, string, TArray<TSVGAttribute>, TEncoding, TUIPointF, TUIRectangle)

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

    Syntax

    Unit: FlexCel.Core

    function TExcelFile.RenderObjectAsSVG(const objectIndex: Integer; shapeProperties: IShapeProperties; const BackgroundColor: TUIColor; const exportType: TSVGExportType; const idPrefix: string; const title: string; const description: string; const extraSVGAttributes: TArray<TSVGAttribute>; const encoding: TEncoding; out origin: TUIPointF; out imageDimensions: TUIRectangle): string; overload;

    Parameters

    <-> Parameter Type Description
    const objectIndex Integer 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 IShapeProperties Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Integer, Boolean).
    const BackgroundColor TUIColor Color for the background of the image. For a transparent background, use TUIColor.Empty.
    const exportType TSVGExportType How much of the SVG will be exported.
    const 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.
    const title string Title for the image. It will be saved inside the SVG file.
    const description string Description for the image. It will be saved inside the SVG file.
    const extraSVGAttributes TArray<TSVGAttribute> Extra attributes to be added to the svg tag.
    const encoding TEncoding 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 TUIPointF 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(Integer) because shadows or rotation of the image.

    Returns

    Might return null if the image is not visible.

    See also

    • TExcelFile

    TExcelFile.RenderObjectAsSVG(TStream, Integer, IShapeProperties, TUIColor, TSVGExportType, string, string, string, TArray<TSVGAttribute>, TEncoding, TUIPointF, TUIRectangle)

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

    Syntax

    Unit: FlexCel.Core

    procedure TExcelFile.RenderObjectAsSVG(const resultStream: TStream; const objectIndex: Integer; shapeProperties: IShapeProperties; const BackgroundColor: TUIColor; const exportType: TSVGExportType; const idPrefix: string; const title: string; const description: string; const extraSVGAttributes: TArray<TSVGAttribute>; const encoding: TEncoding; out origin: TUIPointF; out imageDimensions: TUIRectangle); overload;

    Parameters

    <-> Parameter Type Description
    const resultStream TStream Stream where the data will be saved.
    const objectIndex Integer 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 IShapeProperties Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Integer, Boolean).
    const BackgroundColor TUIColor Color for the background of the image. For a transparent background, use TUIColor.Empty.
    const exportType TSVGExportType How much of the SVG will be exported.
    const 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.
    const title string Title for the image. It will be saved inside the SVG file.
    const description string Description for the image. It will be saved inside the SVG file.
    const extraSVGAttributes TArray<TSVGAttribute> Extra attributes to be added to the svg tag.
    const encoding TEncoding Encoding that will be used for the xml.
    If null, utf-8 will be used.
    out origin TUIPointF 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(Integer) because shadows or rotation of the image.

    See also

    • TExcelFile

    TExcelFile.RenderObjectAsSVG(Integer, Double, IShapeProperties, TUIColor, TSVGExportType, string, string, string, TArray<TSVGAttribute>, TEncoding, TUIPointF, TUIRectangle)

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

    Syntax

    Unit: FlexCel.Core

    function TExcelFile.RenderObjectAsSVG(const objectIndex: Integer; const aPageScale: Double; shapeProperties: IShapeProperties; const BackgroundColor: TUIColor; const exportType: TSVGExportType; const idPrefix: string; const title: string; const description: string; const extraSVGAttributes: TArray<TSVGAttribute>; const encoding: TEncoding; out origin: TUIPointF; out imageDimensions: TUIRectangle): string; overload;

    Parameters

    <-> Parameter Type Description
    const objectIndex Integer 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.
    const aPageScale Double Page scale. Use 1 for 100%%
    shapeProperties IShapeProperties Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Integer, Boolean).
    const BackgroundColor TUIColor Color for the background of the image. For a transparent background, use TUIColor.Empty.
    const exportType TSVGExportType How much of the SVG will be exported.
    const 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.
    const title string Title for the image. It will be saved inside the SVG file.
    const description string Description for the image. It will be saved inside the SVG file.
    const extraSVGAttributes TArray<TSVGAttribute> Extra attributes to be added to the svg tag.
    const encoding TEncoding 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 TUIPointF 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(Integer) because shadows or rotation of the image.

    Returns

    Might return null if the image is not visible.

    See also

    • TExcelFile

    TExcelFile.RenderObjectAsSVG(TStream, Integer, Double, IShapeProperties, TUIColor, TSVGExportType, string, string, string, TArray<TSVGAttribute>, TEncoding, TUIPointF, TUIRectangle)

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

    Syntax

    Unit: FlexCel.Core

    procedure TExcelFile.RenderObjectAsSVG(const resultStream: TStream; const objectIndex: Integer; const aPageScale: Double; shapeProperties: IShapeProperties; const BackgroundColor: TUIColor; const exportType: TSVGExportType; const idPrefix: string; const title: string; const description: string; const extraSVGAttributes: TArray<TSVGAttribute>; const encoding: TEncoding; out origin: TUIPointF; out imageDimensions: TUIRectangle); overload;

    Parameters

    <-> Parameter Type Description
    const resultStream TStream Stream where the data will be saved.
    const objectIndex Integer 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.
    const aPageScale Double Page scale. Use 1 for 100%%
    shapeProperties IShapeProperties Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Integer, Boolean).
    const BackgroundColor TUIColor Color for the background of the image. For a transparent background, use TUIColor.Empty.
    const exportType TSVGExportType How much of the SVG will be exported.
    const 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.
    const title string Title for the image. It will be saved inside the SVG file.
    const description string Description for the image. It will be saved inside the SVG file.
    const extraSVGAttributes TArray<TSVGAttribute> Extra attributes to be added to the svg tag.
    const encoding TEncoding Encoding that will be used for the xml.
    If null, utf-8 will be used.
    out origin TUIPointF 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(Integer) because shadows or rotation of the image.

    See also

    • TExcelFile

    TExcelFile.RenderObjectAsSVG(Integer, Double, IShapeProperties, TUIColor, TSVGExportType, string, string, string, TArray<TSVGAttribute>, TEncoding, Boolean, TUIPointF, TUIRectangle)

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

    Syntax

    Unit: FlexCel.Core

    function TExcelFile.RenderObjectAsSVG(const objectIndex: Integer; const aPageScale: Double; shapeProperties: IShapeProperties; const BackgroundColor: TUIColor; const exportType: TSVGExportType; const idPrefix: string; const title: string; const description: string; const extraSVGAttributes: TArray<TSVGAttribute>; const encoding: TEncoding; const rasterizeSVGImages: Boolean; out origin: TUIPointF; out imageDimensions: TUIRectangle): string; overload; virtual; abstract;

    Parameters

    <-> Parameter Type Description
    const objectIndex Integer 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.
    const aPageScale Double Page scale. Use 1 for 100%%
    shapeProperties IShapeProperties Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Integer, Boolean).
    const BackgroundColor TUIColor Color for the background of the image. For a transparent background, use TUIColor.Empty.
    const exportType TSVGExportType How much of the SVG will be exported.
    const 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.
    const title string Title for the image. It will be saved inside the SVG file.
    const description string Description for the image. It will be saved inside the SVG file.
    const extraSVGAttributes TArray<TSVGAttribute> Extra attributes to be added to the svg tag.
    const encoding TEncoding 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.
    const 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 TUIPointF 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(Integer) because shadows or rotation of the image.

    Returns

    Might return null if the image is not visible.

    See also

    • TExcelFile

    TExcelFile.RenderObjectAsSVG(TStream, Integer, Double, IShapeProperties, TUIColor, TSVGExportType, string, string, string, TArray<TSVGAttribute>, TEncoding, Boolean, TUIPointF, TUIRectangle)

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

    Syntax

    Unit: FlexCel.Core

    procedure TExcelFile.RenderObjectAsSVG(const resultStream: TStream; const objectIndex: Integer; const aPageScale: Double; shapeProperties: IShapeProperties; const BackgroundColor: TUIColor; const exportType: TSVGExportType; const idPrefix: string; const title: string; const description: string; const extraSVGAttributes: TArray<TSVGAttribute>; const encoding: TEncoding; const rasterizeSVGImages: Boolean; out origin: TUIPointF; out imageDimensions: TUIRectangle); overload; virtual; abstract;

    Parameters

    <-> Parameter Type Description
    const resultStream TStream Stream where the data will be saved.
    const objectIndex Integer 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.
    const aPageScale Double Page scale. Use 1 for 100%%
    shapeProperties IShapeProperties Properties of the shape you are about to render. You can get them by calling GetObjectProperties(Integer, Boolean).
    const BackgroundColor TUIColor Color for the background of the image. For a transparent background, use TUIColor.Empty.
    const exportType TSVGExportType How much of the SVG will be exported.
    const 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.
    const title string Title for the image. It will be saved inside the SVG file.
    const description string Description for the image. It will be saved inside the SVG file.
    const extraSVGAttributes TArray<TSVGAttribute> Extra attributes to be added to the svg tag.
    const encoding TEncoding Encoding that will be used for the xml.
    If null, utf-8 will be used.
    const 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 TUIPointF 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(Integer) because shadows or rotation of the image.

    See also

    • TExcelFile
    In This Article
    Back to top FlexCel Studio for VCL and FireMonkey v7.24
    © 2002 - 2025 tmssoftware.com