JavaScript API: replaceVariableImage

replaceVariableImage

PREMIUM TRIAL / ADVANCED

Replaces image variables.

Note

You are reading the JavaScript API documentation. For the PHP API method please go to replacePlaceholderImage.

Description
replaceVariableImage (variables: Map<string, ArrayBuffer>, target: Target = "document", options: OptionsReplaceVariableImage = {}): this

This method allows to replace a placeholder image that may be fully formatted in Word (border, shadows, effects...) by an image of our choice.

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

Code samples

Example #1

The resulting Word document looks like:

Release notes
  • phpdocx 15.0:
    • new method.