JSON API - addCaption
- addBarcode
- addBookmark
- addBreak
- addCaption
- addChart
- addComment
- addCrossReference
- addDateAndHour
- addDropCap
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addLink
- addList
- addMathEquation
- addMergeField
- addPageNumber
- addRuby
- addSimpleField
- addStructuredDocumentTag
- addSVG
- addTab
- addTable
- addTableContents
- addTableFigures
- addText
- addTextBox
- addWordML
- addWordFragment
- embedHTML
- addBackgroundImage
- addFooter
- addFooterSection
- addHeader
- addHeaderSection
- addLineNumbering
- addPageBorders
- addProperties
- addSection
- createCharacterStyle
- createListStyle
- createParagraphStyle
- createTableStyle
- docxSettings
- embedFont
- modifyPageLayout
- removeFooters
- removeHeaders
- setBackgroundColor
- setCompatibilityMode
- setDefaultFont
- setDocumentDefaultStyles
- setLanguage
- setMarkAsFinal
- setRTL
- clearBlocks
- cloneBlock
- deleteBlock
- getTemplateVariables
- getTemplateVariablesType
- modifyInputFields
- modifyMergeFields
- processTemplate
- removeTemplateVariable
- removeTemplateVariableImage
- replaceBlock
- replaceListVariable
- replacePlaceholderImage
- replaceTableVariable
- replaceVariableByExternalFile
- replaceVariableByHTML
- replaceVariableByText
- replaceVariableByWordFragment
- replaceVariableByWordML
- setTemplateSymbol
- setTemplateBlockSymbol
- tickCheckboxes
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.
