JSON API - cloneBlock

cloneBlock

PREMIUM TRIAL / ADVANCED

Clones a block in the document.

Note

You are reading the JSON API documentation. For the PHP API method please go to cloneBlock.

JSON data
Key Description
name The name of the block to be cloned.
occurrence Position of the block to be cloned. 1 as default.
variables

This must be an object with the names of the placeholder block variables as keys and the plain text or WordFragment that should replace them as values.

The "images" key can be added to do image replacements.

removeBlockPlaceholder False as default. If true, remove block placeholders from the cloned content.
type Possible values are: inline (default) or block. Used by WordFragment values.
Code samples

Example #1

A template can be a local file, a Base64 string, or a remote file.

Example #2

A template can be a local file, a Base64 string, or a remote file.

Example #3

A template can be a local file, a Base64 string, or a remote file.

Release notes
  • phpdocx 18.0:
    • new action.