JSON API - replaceVariableImage
replaceVariableImage
PREMIUM
TRIAL / ADVANCED
Replaces a placeholder within an image with a new image.
Note
You are reading the JSON API documentation. For the PHP API method please go to replaceVariableImage.
The placeholder image should be tagged using the alternate text option of the Excel interface (this may depend on the Excel version).
JSON data
| Key | Description |
|---|---|
| variables | Object with the names of the placeholder template image variables as keys and the image paths, base64 contents or streams that should replace them. |
| alt | Alt value. |
| colOffset |
|
| colSize | Number of columns used by the text box. |
| descr | Descr value. |
| hyperlink | If set, adds the image hyperlink (hyperlink or bookmark). |
| mime | Forces a mime (image/jpg, image/jpeg, image/png, image/gif, image/bmp, image/webp). |
| rowOffset |
|
| rowSize | Number of rows used by the text box. |
| target | sheets (default), headers, footers. |
Code samples
Example #1
A template can be a local file, a Base64 string, or a remote file.
Release notes
- phpxlsx 6.0:
- new action.