JSON API - addTextBox
- 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
addTextBox
PREMIUM
TRIAL / ADVANCED
Inserts a text box.
Note
You are reading the JSON API documentation. For the PHP API method please go to addTextBox.
JSON data
| Key | Description |
|---|---|
| content | Text content or WordFragment. |
| align | center, left, right, absolute, inline. |
| border | Border width. |
| borderColor | Hexadecimal value (#ff0000, #0000ff). |
| borderWidth | value in points. |
| contentVerticalAlign | top (default), center or bottom. |
| dashStyle | 'longDashDot', '1 1', '3 1'... |
| direction | ltr, rtl. |
| fillColor | Hexadecimal value (#ff0000, #0000ff). |
| height | Height in points or 'auto'. |
| lineStyle | single, thinThin, thinThick, thickThin, thickBetweenThin |
| marginTop | Top margin. |
| marginRight | Right margin. |
| marginBottom | Bottom margin. |
| marginLeft | Left margin. |
| paddingBottom | Distance in cm. |
| paddingLeft | Distance in mm. |
| paddingRight | Distance in mm. |
| paddingTop | Distance in mm. |
| position | The possible values are: absolute. |
| relativeToHorizontal | margin, page, text, char. |
| relativeToVertical | margin, page, text, line. |
| textboxStyle | Extra textbox styles. Default as 'mso-fit-shape-to-text:t;' if height is 'auto'. |
| textWrap | tight, square, through, none. |
| width | Width in points. |
| z-index | Equivalent to the CSS z-index property. Set a high positive number to make sure that the text box is over other contents. |
Code samples
Example #1
Release notes
- phpdocx 18.0:
- new action.
