addSvg
addSvg
BASIC / ADVANCED / PREMIUM
Inserts an SVG into the Excel spreadsheet.
Description
public addSvg($svg, $position, $options = array())
You may use this method to insert an SVG content, as file or string, into the Excel spreadsheet.
To keep compatibility with XLSX readers not compatible with SVG images, a PNG image with the same content is added too in the spreadsheet.
Parameters
svg
File path or SVG content.
position
Cell position in the active sheet: A1, C3, AB7...
options
| Key | Type | Description |
|---|---|---|
| colOffset | array |
|
| colSize | int | Number of columns used by the image. |
| descr | string | Descr value. |
| dpi | int | Dots per inch. Autodetect if not set. |
| editAs | string | Possible values are:
|
| name | string | Sets a name value. |
| rowOffset | array |
|
| rowSize | int | Number of rows used by the image. |
Exceptions
ImageMagick extension is not enabled.
Release notes
- phpxlsx 5.0:
- improved working with legacy drawing contents.
- removed PHP Warnings when images to be added do not exist.
- phpxlsx 2.0:
- new method.