replaceVariableImage

replaceVariableImage

BASIC / ADVANCED / PREMIUM

Replaces image placeholders with new images.

Description
public replaceVariableImage($variables, $options = array())

This method replaces image placeholders with new images.

The image placeholder should be tagged using the alternate text option of the PowerPoint interface (this may depend on the PowerPoint version).

Parameters

variables

Array with the names of the placeholder template variables as keys and the videos that should replace them.

options

The possible keys and values of this array are:

Key Type Description
activeSlide bool If true, get only the active slide. Default as false.
mime string Forces a mime: image/jpg, image/jpeg, image/png, image/gif.
target string slides (default).
Exceptions

Image doesn't exist.

Image format is not supported.

Mime option is not set and getimagesizefromstring is not available.

Code samples

Example #1

The resulting PPTX looks like:

Release notes
  • phppptx 1.0: new method.