JSON API - addTextBox

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.