JSON API - addCaption

addCaption

PREMIUM TRIAL / ADVANCED

Inserts a caption.

Note

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

JSON data

Other styles from createParagraphStyle can be used.

Key Description
text Text content.
align Text align.
bookmarkName Set a custom bookmark name. Default as _GoBack.
color Text color. HEX value. Default as 1F497D.
fontSize Text size in half-points. Default as 18.
keepNext Keep in the same page the current paragraph with next paragraph. Default as false.
lineSpacing Text line spacing. Default as 240.
showLabel Show default value. Default as true
pStyle Set a custom style name applied to the paragraph. This option overwrites the 'styleName' option as custom paragraph style
styleName Allow setting a custom style name, useful to generate table of figures based on style names. Default as Caption
wrapTextInBookmarks Wrap text content between bookmarks. Default as true.
Code samples

Example #1

Release notes
  • phpdocx 18.0:
    • new action.