TXlsFile.RenderObjectAsSVG Method
Overloads
- TXlsFile.RenderObjectAsSVG(Integer, Double, IShapeProperties, TUIColor, TSVGExportType, string, string, string, TArray<TSVGAttribute>, TEncoding, Boolean, TUIPointF, TUIRectangle)
- TXlsFile.RenderObjectAsSVG(TStream, Integer, Double, IShapeProperties, TUIColor, TSVGExportType, string, string, string, TArray<TSVGAttribute>, TEncoding, Boolean, TUIPointF, TUIRectangle)
TXlsFile.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.XlsAdapter
function TXlsFile.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; override;
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 TExcelFile.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 TExcelFile.GetImageProperties(Integer) because shadows or rotation of the image. |
Returns
Might return null if the image is not visible.
See also
TXlsFile.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.XlsAdapter
procedure TXlsFile.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; override;
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 TExcelFile.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 TExcelFile.GetImageProperties(Integer) because shadows or rotation of the image. |