Documentation

Paragraph extends Border

Paragraph style

OOXML:

  • General: alignment, outline level
  • Indentation: left, right, firstline, hanging
  • Spacing: before, after, line spacing
  • Pagination: widow control, keep next, keep line, page break before
  • Formatting exception: suppress line numbers, don't hyphenate
  • Textbox options
  • Tabs
  • Shading
  • Borders

OpenOffice:

  • Indents & spacing
  • Alignment
  • Text flow
  • Outline & numbering
  • Tabs
  • Dropcaps
  • Tabs
  • Borders
  • Background
Tags
see
http://www.schemacentral.com/sc/ooxml/t-w_CT_PPr.html

Table of Contents

LINE_HEIGHT  = 240
$aliases  : array<string|int, mixed>
Aliases
$borderBottomColor  : string
Border Bottom Color
$borderBottomSize  : int|float
Border Bottom Size
$borderBottomStyle  : string
Border Bottom Style
$borderLeftColor  : string
Border Left Color
$borderLeftSize  : int|float
Border Left Size
$borderLeftStyle  : string
Border Left Style
$borderRightColor  : string
Border Right Color
$borderRightSize  : int|float
Border Right Size
$borderRightStyle  : string
Border Right Style
$borderTopColor  : string
Border Top Color
$borderTopSize  : int|float
Border Top Size
$borderTopStyle  : string
Border Top Style
$index  : int|null
Index number in Style collection for named style
$styleName  : string
Style name
$alignment  : string
$basedOn  : string
Parent style
$bidi  : bool
Right to Left Paragraph Layout
$contextualSpacing  : bool
Ignore Spacing Above and Below When Using Identical Styles
$indentation  : Indentation|null
Indentation
$isAuto  : bool
Is this an automatic style? (Used primarily in OpenDocument driver)
$keepLines  : bool
Keep all lines on one page
$keepNext  : bool
Keep paragraph with next paragraph
$lineHeight  : int
Text line height
$next  : string
Style for next paragraph
$numLevel  : int
Numbering level
$numStyle  : string
Numbering style name
$pageBreakBefore  : bool
Start paragraph on next page
$shading  : Shading
Shading
$spacing  : Spacing
Spacing
$suppressAutoHyphens  : bool
Suppress hyphenation for paragraph
$tabs  : array<string|int, Tab>
Set of Custom Tab Stops
$textAlignment  : string
Vertical Character Alignment on Line
$widowControl  : bool
Allow first/last line to display on a separate page
getAlign()  : string
getAlignment()  : string
getBasedOn()  : string
Get parent style ID
getBorderBottomColor()  : string
Get border bottom color
getBorderBottomSize()  : int|float
Get border bottom size
getBorderBottomStyle()  : string
Get border bottom style
getBorderColor()  : array<string|int, string>
Get border color
getBorderLeftColor()  : string
Get border left color
getBorderLeftSize()  : int|float
Get border left size
getBorderLeftStyle()  : string
Get border left style
getBorderRightColor()  : string
Get border right color
getBorderRightSize()  : int|float
Get border right size
getBorderRightStyle()  : string
Get border right style
getBorderSize()  : array<string|int, int>
Get border size
getBorderStyle()  : array<string|int, string>
Get border style
getBorderTopColor()  : string
Get border top color
getBorderTopSize()  : int|float
Get border top size
getBorderTopStyle()  : string
Get border top style
getChildStyleValue()  : mixed
Return style value of child style object, e.g. `left` from `Indentation` child style of `Paragraph`
getHanging()  : int
Get hanging
getIndent()  : int
Get indentation
getIndentation()  : Indentation
Get shading
getIndex()  : int|null
Get index number
getKeepLines()  : mixed
Get keep all lines on one page setting
getKeepNext()  : mixed
Get keep paragraph with next paragraph setting
getLineHeight()  : int|float
Get line height
getNext()  : string
Get style for next paragraph
getNumLevel()  : int
Get numbering level
getNumStyle()  : string
Get numbering style name
getPageBreakBefore()  : mixed
Get start paragraph on next page setting
getShading()  : Shading
Get shading
getSpace()  : Spacing
Get spacing
getSpaceAfter()  : int
Get space after paragraph
getSpaceBefore()  : int
Get space before paragraph
getSpacing()  : int|float
Get spacing between lines
getSpacingLineRule()  : string
Get spacing line rule
getStyleName()  : string
Get style name
getStyleValues()  : array<string|int, mixed>
Get style values
getTabs()  : array<string|int, Tab>
Get tabs
getTextAlignment()  : string
Get textAlignment
getWidowControl()  : mixed
Get allow first/last line to display on a separate page setting
hasBorder()  : bool
Check if any of the border is not null
hasContextualSpacing()  : bool
Get contextualSpacing
hasPageBreakBefore()  : bool
Get start paragraph on next page setting
hasSuppressAutoHyphens()  : bool
hasWidowControl()  : bool
Get allow first/last line to display on a separate page setting
isAuto()  : bool
Get is automatic style flag
isBidi()  : bool
Get bidirectional
isKeepLines()  : bool
Get keep all lines on one page setting
isKeepNext()  : bool
Get keep paragraph with next paragraph setting
setAlign()  : self
setAlignment()  : self
setArrayStyle()  : self
Set style using associative array
setAuto()  : self
Set is automatic style flag
setBasedOn()  : self
Set parent style ID
setBidi()  : self
Set bidi
setBorderBottomColor()  : self
Set border bottom color
setBorderBottomSize()  : self
Set border bottom size
setBorderBottomStyle()  : self
Set border bottom style
setBorderColor()  : self
Set border color
setBorderLeftColor()  : self
Set border left color
setBorderLeftSize()  : self
Set border left size
setBorderLeftStyle()  : self
Set border left style
setBorderRightColor()  : self
Set border right color
setBorderRightSize()  : self
Set border right size
setBorderRightStyle()  : self
Set border right style
setBorderSize()  : self
Set border size
setBorderStyle()  : self
Set border style
setBorderTopColor()  : self
Set border top color
setBorderTopSize()  : self
Set border top size
setBorderTopStyle()  : self
Set border top Style
setContextualSpacing()  : self
Set contextualSpacing
setHanging()  : self
Set hanging
setIndent()  : self
Set indentation
setIndentation()  : self
Set shading
setIndex()  : self
Set index number
setKeepLines()  : self
Set keep all lines on one page setting
setKeepNext()  : self
Set keep paragraph with next paragraph setting
setLineHeight()  : self
Set the line height
setNext()  : self
Set style for next paragraph
setNumLevel()  : self
Set numbering level
setNumStyle()  : self
Set numbering style name
setPageBreakBefore()  : self
Set start paragraph on next page setting
setShading()  : self
Set shading
setSpace()  : self
Set spacing
setSpaceAfter()  : self
Set space after paragraph
setSpaceBefore()  : self
Set space before paragraph
setSpacing()  : self
Set spacing between lines
setSpacingLineRule()  : Paragraph
Set the spacing line rule
setStyleByArray()  : self
Set style by using associative array
setStyleName()  : self
Set style name
setStyleValue()  : self
Set Style value
setSuppressAutoHyphens()  : mixed
setTabs()  : self
Set tabs
setTextAlignment()  : self
Set textAlignment
setWidowControl()  : self
Set keep paragraph with next paragraph setting
setBoolVal()  : bool
Set bool value
setEnumVal()  : mixed
Set enum value
setFloatVal()  : float|null
Set float value: Convert string that contains only numeric into float
setIntVal()  : int|null
Set integer value: Convert string that contains only numeric into integer
setNonEmptyVal()  : string
Set default for null and empty value
setNumericVal()  : int|float|null
Set numeric value
setObjectVal()  : mixed
Set object value
setPairedVal()  : self
Set $property value and set $pairProperty = false when $value = true

Constants

LINE_HEIGHT

public mixed LINE_HEIGHT = 240
Tags
const

int One line height equals 240 twip

Properties

$aliases

Aliases

protected array<string|int, mixed> $aliases = array('line-height' => 'lineHeight', 'line-spacing' => 'spacing')

$borderBottomColor

Border Bottom Color

protected string $borderBottomColor

$borderBottomSize

Border Bottom Size

protected int|float $borderBottomSize

$borderBottomStyle

Border Bottom Style

protected string $borderBottomStyle

$borderLeftColor

Border Left Color

protected string $borderLeftColor

$borderLeftSize

Border Left Size

protected int|float $borderLeftSize

$borderLeftStyle

Border Left Style

protected string $borderLeftStyle

$borderRightColor

Border Right Color

protected string $borderRightColor

$borderRightSize

Border Right Size

protected int|float $borderRightSize

$borderRightStyle

Border Right Style

protected string $borderRightStyle

$borderTopColor

Border Top Color

protected string $borderTopColor

$borderTopSize

Border Top Size

protected int|float $borderTopSize

$borderTopStyle

Border Top Style

protected string $borderTopStyle

$index

Index number in Style collection for named style

protected int|null $index

This number starts from one and defined in Style::setStyleValues()

$basedOn

Parent style

private string $basedOn = 'Normal'

$bidi

Right to Left Paragraph Layout

private bool $bidi = false

$contextualSpacing

Ignore Spacing Above and Below When Using Identical Styles

private bool $contextualSpacing = false

$isAuto

Is this an automatic style? (Used primarily in OpenDocument driver)

private bool $isAuto = false
Tags
since
0.11.0

$keepLines

Keep all lines on one page

private bool $keepLines = false

$keepNext

Keep paragraph with next paragraph

private bool $keepNext = false

$lineHeight

Text line height

private int $lineHeight

$next

Style for next paragraph

private string $next

$numLevel

Numbering level

private int $numLevel = 0

$numStyle

Numbering style name

private string $numStyle

$pageBreakBefore

Start paragraph on next page

private bool $pageBreakBefore = false

$suppressAutoHyphens

Suppress hyphenation for paragraph

private bool $suppressAutoHyphens = false

$tabs

Set of Custom Tab Stops

private array<string|int, Tab> $tabs = array()

$textAlignment

Vertical Character Alignment on Line

private string $textAlignment

$widowControl

Allow first/last line to display on a separate page

private bool $widowControl = true

Methods

getAlign()

public getAlign() : string
Tags
deprecated
0.13.0

Use the getAlignment method instead.

codeCoverageIgnore
Return values
string

getAlignment()

public getAlignment() : string
Tags
since
0.13.0
Return values
string

getBasedOn()

Get parent style ID

public getBasedOn() : string
Return values
string

getBorderBottomColor()

Get border bottom color

public getBorderBottomColor() : string
Return values
string

getBorderBottomSize()

Get border bottom size

public getBorderBottomSize() : int|float
Return values
int|float

getBorderBottomStyle()

Get border bottom style

public getBorderBottomStyle() : string
Return values
string

getBorderColor()

Get border color

public getBorderColor() : array<string|int, string>
Return values
array<string|int, string>

getBorderLeftColor()

Get border left color

public getBorderLeftColor() : string
Return values
string

getBorderLeftSize()

Get border left size

public getBorderLeftSize() : int|float
Return values
int|float

getBorderLeftStyle()

Get border left style

public getBorderLeftStyle() : string
Return values
string

getBorderRightColor()

Get border right color

public getBorderRightColor() : string
Return values
string

getBorderRightSize()

Get border right size

public getBorderRightSize() : int|float
Return values
int|float

getBorderRightStyle()

Get border right style

public getBorderRightStyle() : string
Return values
string

getBorderSize()

Get border size

public getBorderSize() : array<string|int, int>
Return values
array<string|int, int>

getBorderStyle()

Get border style

public getBorderStyle() : array<string|int, string>
Return values
array<string|int, string>

getBorderTopColor()

Get border top color

public getBorderTopColor() : string
Return values
string

getBorderTopSize()

Get border top size

public getBorderTopSize() : int|float
Return values
int|float

getBorderTopStyle()

Get border top style

public getBorderTopStyle() : string
Return values
string

getChildStyleValue()

Return style value of child style object, e.g. `left` from `Indentation` child style of `Paragraph`

public getChildStyleValue(AbstractStyle $substyleObject, string $substyleProperty) : mixed
Parameters
$substyleObject : AbstractStyle
$substyleProperty : string
Tags
since
0.12.0
Return values
mixed

getHanging()

Get hanging

public getHanging() : int
Return values
int

getIndent()

Get indentation

public getIndent() : int
Return values
int

getIndex()

Get index number

public getIndex() : int|null
Return values
int|null

getKeepLines()

Get keep all lines on one page setting

public getKeepLines() : mixed
Tags
deprecated
0.10.0
codeCoverageIgnore
Return values
mixed

getKeepNext()

Get keep paragraph with next paragraph setting

public getKeepNext() : mixed
Tags
deprecated
0.10.0
codeCoverageIgnore
Return values
mixed

getLineHeight()

Get line height

public getLineHeight() : int|float
Return values
int|float

getNext()

Get style for next paragraph

public getNext() : string
Return values
string

getNumLevel()

Get numbering level

public getNumLevel() : int
Return values
int

getNumStyle()

Get numbering style name

public getNumStyle() : string
Return values
string

getPageBreakBefore()

Get start paragraph on next page setting

public getPageBreakBefore() : mixed
Tags
deprecated
0.10.0
codeCoverageIgnore
Return values
mixed

getSpace()

Get spacing

public getSpace() : Spacing
Tags
todo

Rename to getSpacing in 1.0

Return values
Spacing

getSpaceAfter()

Get space after paragraph

public getSpaceAfter() : int
Return values
int

getSpaceBefore()

Get space before paragraph

public getSpaceBefore() : int
Return values
int

getSpacing()

Get spacing between lines

public getSpacing() : int|float
Return values
int|float

getSpacingLineRule()

Get spacing line rule

public getSpacingLineRule() : string
Return values
string

getStyleName()

Get style name

public getStyleName() : string
Return values
string

getStyleValues()

Get style values

public getStyleValues() : array<string|int, mixed>

An experiment to retrieve all style values in one function. This will reduce function call and increase cohesion between functions. Should be implemented in all styles.

Tags
ignoreScrutinizerPatch
Return values
array<string|int, mixed>

getTabs()

Get tabs

public getTabs() : array<string|int, Tab>
Return values
array<string|int, Tab>

getTextAlignment()

Get textAlignment

public getTextAlignment() : string
Return values
string

getWidowControl()

Get allow first/last line to display on a separate page setting

public getWidowControl() : mixed
Tags
deprecated
0.10.0
codeCoverageIgnore
Return values
mixed

hasBorder()

Check if any of the border is not null

public hasBorder() : bool
Return values
bool

hasContextualSpacing()

Get contextualSpacing

public hasContextualSpacing() : bool
Return values
bool

hasPageBreakBefore()

Get start paragraph on next page setting

public hasPageBreakBefore() : bool
Return values
bool

hasSuppressAutoHyphens()

public hasSuppressAutoHyphens() : bool
Return values
bool

hasWidowControl()

Get allow first/last line to display on a separate page setting

public hasWidowControl() : bool
Return values
bool

isAuto()

Get is automatic style flag

public isAuto() : bool
Return values
bool

isBidi()

Get bidirectional

public isBidi() : bool
Return values
bool

isKeepLines()

Get keep all lines on one page setting

public isKeepLines() : bool
Return values
bool

isKeepNext()

Get keep paragraph with next paragraph setting

public isKeepNext() : bool
Return values
bool

setAlign()

public setAlign([string $value = null ]) : self
Parameters
$value : string = null
Tags
deprecated
0.13.0

Use the setAlignment method instead.

codeCoverageIgnore
Return values
self

setAlignment()

public setAlignment(string $value) : self
Parameters
$value : string
Tags
since
0.13.0
Return values
self

setArrayStyle()

Set style using associative array

public setArrayStyle([array<string|int, mixed> $style = array() ]) : self
Parameters
$style : array<string|int, mixed> = array()
Tags
deprecated
0.11.0
codeCoverageIgnore
Return values
self

setAuto()

Set is automatic style flag

public setAuto([bool $value = true ]) : self
Parameters
$value : bool = true
Return values
self

setBasedOn()

Set parent style ID

public setBasedOn([string $value = 'Normal' ]) : self
Parameters
$value : string = 'Normal'
Return values
self

setBidi()

Set bidi

public setBidi(bool $bidi) : self
Parameters
$bidi : bool

Set to true to write from right to left

Return values
self

setBorderBottomColor()

Set border bottom color

public setBorderBottomColor([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setBorderBottomSize()

Set border bottom size

public setBorderBottomSize([int|float $value = null ]) : self
Parameters
$value : int|float = null
Return values
self

setBorderBottomStyle()

Set border bottom style

public setBorderBottomStyle([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setBorderColor()

Set border color

public setBorderColor([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setBorderLeftColor()

Set border left color

public setBorderLeftColor([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setBorderLeftSize()

Set border left size

public setBorderLeftSize([int|float $value = null ]) : self
Parameters
$value : int|float = null
Return values
self

setBorderLeftStyle()

Set border left style

public setBorderLeftStyle([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setBorderRightColor()

Set border right color

public setBorderRightColor([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setBorderRightSize()

Set border right size

public setBorderRightSize([int|float $value = null ]) : self
Parameters
$value : int|float = null
Return values
self

setBorderRightStyle()

Set border right style

public setBorderRightStyle([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setBorderSize()

Set border size

public setBorderSize([int|float $value = null ]) : self
Parameters
$value : int|float = null
Return values
self

setBorderStyle()

Set border style

public setBorderStyle([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setBorderTopColor()

Set border top color

public setBorderTopColor([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setBorderTopSize()

Set border top size

public setBorderTopSize([int|float $value = null ]) : self
Parameters
$value : int|float = null
Return values
self

setBorderTopStyle()

Set border top Style

public setBorderTopStyle([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setContextualSpacing()

Set contextualSpacing

public setContextualSpacing(bool $contextualSpacing) : self
Parameters
$contextualSpacing : bool
Return values
self

setHanging()

Set hanging

public setHanging([int $value = null ]) : self
Parameters
$value : int = null
Return values
self

setIndent()

Set indentation

public setIndent([int $value = null ]) : self
Parameters
$value : int = null
Return values
self

setIndentation()

Set shading

public setIndentation([mixed $value = null ]) : self
Parameters
$value : mixed = null
Return values
self

setIndex()

Set index number

public setIndex([int|null $value = null ]) : self
Parameters
$value : int|null = null
Return values
self

setKeepLines()

Set keep all lines on one page setting

public setKeepLines([bool $value = true ]) : self
Parameters
$value : bool = true
Return values
self

setKeepNext()

Set keep paragraph with next paragraph setting

public setKeepNext([bool $value = true ]) : self
Parameters
$value : bool = true
Return values
self

setLineHeight()

Set the line height

public setLineHeight(int|float|string $lineHeight) : self
Parameters
$lineHeight : int|float|string
Tags
throws
InvalidStyleException
Return values
self

setNext()

Set style for next paragraph

public setNext([string $value = null ]) : self
Parameters
$value : string = null
Return values
self

setNumLevel()

Set numbering level

public setNumLevel(int $value) : self
Parameters
$value : int
Return values
self

setNumStyle()

Set numbering style name

public setNumStyle(string $value) : self
Parameters
$value : string
Return values
self

setPageBreakBefore()

Set start paragraph on next page setting

public setPageBreakBefore([bool $value = true ]) : self
Parameters
$value : bool = true
Return values
self

setShading()

Set shading

public setShading([mixed $value = null ]) : self
Parameters
$value : mixed = null
Return values
self

setSpace()

Set spacing

public setSpace([mixed $value = null ]) : self
Parameters
$value : mixed = null
Tags
todo

Rename to setSpacing in 1.0

Return values
self

setSpaceAfter()

Set space after paragraph

public setSpaceAfter([int $value = null ]) : self
Parameters
$value : int = null
Return values
self

setSpaceBefore()

Set space before paragraph

public setSpaceBefore([int $value = null ]) : self
Parameters
$value : int = null
Return values
self

setSpacing()

Set spacing between lines

public setSpacing([int|float $value = null ]) : self
Parameters
$value : int|float = null
Return values
self

setSpacingLineRule()

Set the spacing line rule

public setSpacingLineRule(string $value) : Paragraph
Parameters
$value : string

Possible values are defined in LineSpacingRule

Return values
Paragraph

setStyleByArray()

Set style by using associative array

public setStyleByArray([array<string|int, mixed> $values = array() ]) : self
Parameters
$values : array<string|int, mixed> = array()
Return values
self

setStyleName()

Set style name

public setStyleName(string $value) : self
Parameters
$value : string
Return values
self

setStyleValue()

Set Style value

public setStyleValue(string $key, mixed $value) : self
Parameters
$key : string
$value : mixed
Return values
self

setSuppressAutoHyphens()

public setSuppressAutoHyphens(bool $suppressAutoHyphens) : mixed
Parameters
$suppressAutoHyphens : bool
Return values
mixed

setTabs()

Set tabs

public setTabs([array<string|int, mixed> $value = null ]) : self
Parameters
$value : array<string|int, mixed> = null
Return values
self

setTextAlignment()

Set textAlignment

public setTextAlignment(string $textAlignment) : self
Parameters
$textAlignment : string
Return values
self

setWidowControl()

Set keep paragraph with next paragraph setting

public setWidowControl([bool $value = true ]) : self
Parameters
$value : bool = true
Return values
self

setBoolVal()

Set bool value

protected setBoolVal(bool $value, bool $default) : bool
Parameters
$value : bool
$default : bool
Return values
bool

setEnumVal()

Set enum value

protected setEnumVal([mixed $value = null ][, array<string|int, mixed> $enum = array() ][, mixed $default = null ]) : mixed
Parameters
$value : mixed = null
$enum : array<string|int, mixed> = array()
$default : mixed = null
Tags
throws
InvalidArgumentException
Return values
mixed

setFloatVal()

Set float value: Convert string that contains only numeric into float

protected setFloatVal(mixed $value[, float|null $default = null ]) : float|null
Parameters
$value : mixed
$default : float|null = null
Return values
float|null

setIntVal()

Set integer value: Convert string that contains only numeric into integer

protected setIntVal(int|null $value[, int|null $default = null ]) : int|null
Parameters
$value : int|null
$default : int|null = null
Return values
int|null

setNonEmptyVal()

Set default for null and empty value

protected setNonEmptyVal(string $value, string $default) : string
Parameters
$value : string

(was: mixed)

$default : string

(was: mixed)

Return values
string

(was: mixed)

setNumericVal()

Set numeric value

protected setNumericVal(mixed $value[, int|float|null $default = null ]) : int|float|null
Parameters
$value : mixed
$default : int|float|null = null
Return values
int|float|null

setObjectVal()

Set object value

protected setObjectVal(mixed $value, string $styleName, mixed &$style) : mixed
Parameters
$value : mixed
$styleName : string
$style : mixed
Return values
mixed

setPairedVal()

Set $property value and set $pairProperty = false when $value = true

protected setPairedVal(bool &$property, bool &$pairProperty, bool $value) : self
Parameters
$property : bool
$pairProperty : bool
$value : bool
Return values
self

Search results