addImage
addImage
BASIC / ADVANCED / PREMIUM
Inserts an image into the PowerPoint presentation.
Description
public addImage($image, $position, $imageStyles = array(), $options = array())
This method inserts images (png, jpg, jpeg, gif, bmp, webp) into the PowerPoint presentation.
Parameters
image
Image path, base64, stream or GdImage.
position
Key | Type | Description |
---|---|---|
new | array |
A new position is generated.
|
imageStyles
Key | Type | Description |
---|---|---|
border | array |
|
descr | string | Descr value. |
hyperlink | string | Hyperlink: external, bookmark (#firstslide, #lastslide, #nextslide, #previousslide) or slide (#slide + position) |
rotation | int | Rotation value. |
options
Key | Type | Description |
---|---|---|
mime | string | Forces a mime (image/jpg, image/jpeg, image/png, image/gif, image/bmp, image/webp). |
Exceptions
Image doesn't exist.
Image format is not supported.
Mime option is not set and getimagesizefromstring is not available.
Size not valid.
Hyperlink slide position not valid.
Position not valid.
Release notes
- phppptx 3.0:
- WebP images.
- GdImage as image source.
- phppptx 1.0:
- new method.