addCaption
- addBibliography
- addBookmark
- addBreak
- addCaption
- addChart
- addCitation
- addComment
- addCrossReference
- addDateAndHour
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addLink
- addList
- addMathEquation
- addMergeField
- addOLE
- addOnlineVideo
- addPageNumber
- addShape
- addSimpleField
- addSource
- addStructuredDocumentTag
- addSVG
- addTab
- addTable
- addTableAuthorities
- addTableContents
- addTableFigures
- addText
- addTextBox
- addWordFragment
- addWordML
- embedHTML
- addBackgroundImage
- addFooter
- addFooterSection
- addHeader
- addHeaderSection
- addLineNumbering
- addMacroFromDoc
- addPageBorders
- addProperties
- addSection
- createDocx
- createDocxAndDownload
- createCharacterStyle
- createListStyle
- createParagraphStyle
- createTableStyle
- docxSettings
- embedFont
- importChartStyle
- importHeadersAndFooters
- importListStyle
- importStyles
- importStylesWordDefault
- modifyPageLayout
- parseStyles
- removeFooters
- removeHeaders
- setBackgroundColor
- setDecimalSymbol
- setDefaultFont
- setDocumentDefaultStyles
- setEncodeUTF8
- 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

Inserts a caption into the Word document.
Description
public addCaption ($text, [array $options] )
Parameters
text
Caption text.
options
The possible keys and values are (required options are shown with yellow background):
Key | Type | Description |
---|---|---|
align | string | Text align. |
bookmarkName | string | Set a custom bookmark name. Default as _GoBack. |
color | string | Text color. HEX value. Default as 1F497D. |
fontSize | int | Text size in half-points. Default as 18. |
keepNext | bool | Keep in the same page the current paragraph with next paragraph. Default as false. |
lineSpacing | int | Text line spacing. Default as 240. |
showLabel | bool | Show default value. Default as true |
styleName | string | Allow setting a custom style name, useful to generate table of figures based on style names. Default as Caption |
wrapTextInBookmarks | bool | Wrap text content between bookmarks. Default as true. |
Other styles from createParagraphStyle can be used