From 85d32c6409a445fb4c5ad0b4b3b90623c8cc820e Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 19:24:44 -0500 Subject: [PATCH 001/110] Update section.md --- docs/usage/styles/section.md | 52 +++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/docs/usage/styles/section.md b/docs/usage/styles/section.md index 2be22e8077..36913835aa 100644 --- a/docs/usage/styles/section.md +++ b/docs/usage/styles/section.md @@ -1,28 +1,30 @@ # Section +- Extends Border + * See [`\PhpOffice\PhpWord\Style\Border`](/docs/usage/styles/border) for additional settings. -Available Section style options: +## Constants +- Orientation + * `ORIENTATION_PORTRAIT` + * `ORIENTATION_LANDSCAPE` -- ``borderBottomColor``. Border bottom color. -- ``borderBottomSize``. Border bottom size in *twip*. -- ``borderLeftColor``. Border left color. -- ``borderLeftSize``. Border left size in *twip*. -- ``borderRightColor``. Border right color. -- ``borderRightSize``. Border right size in *twip*. -- ``borderTopColor``. Border top color. -- ``borderTopSize``. Border top size in *twip*. -- ``breakType``. Section break type (nextPage, nextColumn, continuous, evenPage, oddPage). -- ``colsNum``. Number of columns. -- ``colsSpace``. Spacing between columns. -- ``footerHeight``. Spacing to bottom of footer. -- ``gutter``. Page gutter spacing. -- ``headerHeight``. Spacing to top of header. -- ``marginTop``. Page margin top in *twip*. -- ``marginLeft``. Page margin left in *twip*. -- ``marginRight``. Page margin right in *twip*. -- ``marginBottom``. Page margin bottom in *twip*. -- ``orientation``. Page orientation (``portrait``, which is default, or ``landscape``). - See ``\PhpOffice\PhpWord\Style\Section::ORIENTATION_...`` class constants for possible values -- ``pageSizeH``. Page height in *twip*. Implicitly defined by ``orientation`` option. Any changes are discouraged. -- ``pageSizeW``. Page width in *twip*. Implicitly defined by ``orientation`` option. Any changes are discouraged. -- ``vAlign``. Vertical Page Alignment - See ``\PhpOffice\PhpWord\SimpleType\VerticalJc`` for possible values \ No newline at end of file +## Paper Setup +- `orientation`. Page orientation. `ORIENTATION_PORTRAIT` is default. + * See constants above for possible values. +- `paper`. Paper size. `A4` is default. + * See `\PhpOffice\PhpWord\Style\Paper` for possible values +- `pageSizeH`. Page height in *twip*. `16837.79527559` is default. +- `pageSizeW`. Page width in *twip*. `11905.511811024` is default. + +## Section Setup +- `headerHeight`. Spacing to top of header. `720` is default. +- `footerHeight`. Spacing to bottom of footer. `720` is default. +- `breakType`. Section break type (`nextPage`, `nextColumn`, `continuous`, `evenPage`, `oddPage`). +- `pageNumberingStart`. Starting page number. +- `lineNumbering`. Line numbering. + * See [`\PhpOffice\PhpWord\Style\LineNumbering`](/docs/usage/styles/linenumbering) for possible values. +- `vAlign`. Vertical page alignment. + * See [`\PhpOffice\PhpWord\SimpleType\VerticalJc`](/docs/usage/simpletypes/verticaljc) for possible values. + +## Columns +- `colsNum`. Number of columns. `1` is default. +- `colsSpace`. Spacing between columns. `720` is default. From cc06c585fc0c6d530aea883e11b91ad8886cff66 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 19:28:16 -0500 Subject: [PATCH 002/110] Create border.md --- docs/usage/styles/border.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 docs/usage/styles/border.md diff --git a/docs/usage/styles/border.md b/docs/usage/styles/border.md new file mode 100644 index 0000000000..54492a844c --- /dev/null +++ b/docs/usage/styles/border.md @@ -0,0 +1,21 @@ +# Border + +## Margins +- `marginTop`. Page margin top in *twip*. `1440` is default. +- `marginLeft`. Page margin left in *twip*. `1440` is default. +- `marginRight`. Page margin right in *twip*. `1440` is default. +- `marginBottom`. Page margin bottom in *twip*. `1440` is default. + +## Borders +- `borderTopSize`. Border top size in *twip*. +- `borderTopColor`. Border top color. +- `borderTopStyle`. Border top style. +- `borderLeftSize`. Border left size in *twip*. +- `borderLeftColor`. Border left color. +- `borderLeftStyle`. Border left style. +- `borderRightSize`. Border right size in *twip*. +- `borderRightColor`. Border right color. +- `borderRightStyle`. Border right style. +- `borderBottomSize`. Border bottom size in *twip*. +- `borderBottomColor`. Border bottom color. +- `borderBottomStyle`. Border bottom style. From db7765b483499fa02a4f3e7e272e62e8d0f6822b Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 19:30:31 -0500 Subject: [PATCH 003/110] Update section.md --- docs/usage/styles/section.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/usage/styles/section.md b/docs/usage/styles/section.md index 36913835aa..9177de6a4f 100644 --- a/docs/usage/styles/section.md +++ b/docs/usage/styles/section.md @@ -11,15 +11,16 @@ - `orientation`. Page orientation. `ORIENTATION_PORTRAIT` is default. * See constants above for possible values. - `paper`. Paper size. `A4` is default. - * See `\PhpOffice\PhpWord\Style\Paper` for possible values -- `pageSizeH`. Page height in *twip*. `16837.79527559` is default. + * See [`\PhpOffice\PhpWord\Style\Paper`](/docs/usage/styles/paper) for possible values - `pageSizeW`. Page width in *twip*. `11905.511811024` is default. +- `pageSizeH`. Page height in *twip*. `16837.79527559` is default. +- `gutter`. Page gutter spacing. `0` is default. ## Section Setup - `headerHeight`. Spacing to top of header. `720` is default. - `footerHeight`. Spacing to bottom of footer. `720` is default. -- `breakType`. Section break type (`nextPage`, `nextColumn`, `continuous`, `evenPage`, `oddPage`). - `pageNumberingStart`. Starting page number. +- `breakType`. Section break type (`nextPage`, `nextColumn`, `continuous`, `evenPage`, `oddPage`). - `lineNumbering`. Line numbering. * See [`\PhpOffice\PhpWord\Style\LineNumbering`](/docs/usage/styles/linenumbering) for possible values. - `vAlign`. Vertical page alignment. From f86836844eda771f7b48a4c1d9a254d022388c5c Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 19:48:44 -0500 Subject: [PATCH 004/110] Create paper.md --- docs/usage/styles/paper.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/usage/styles/paper.md diff --git a/docs/usage/styles/paper.md b/docs/usage/styles/paper.md new file mode 100644 index 0000000000..571504c48d --- /dev/null +++ b/docs/usage/styles/paper.md @@ -0,0 +1,12 @@ +# Paper + +## Constants +- Sizes + * `A3`, `A4`, `A5`, `B5` + * `Letter`, `Legal`, `Folio` + +## Options +- `size`. Page size. `A4` is default. + * See sizes above for possible values. +- `width`. Page width in *twip*. +- `height`. Page height in *twip*. From 548e1e08cb0203127e5f49256efba8bce124321c Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 19:50:23 -0500 Subject: [PATCH 005/110] Update section.md --- docs/usage/styles/section.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/docs/usage/styles/section.md b/docs/usage/styles/section.md index 9177de6a4f..4ad6cd6def 100644 --- a/docs/usage/styles/section.md +++ b/docs/usage/styles/section.md @@ -7,7 +7,7 @@ * `ORIENTATION_PORTRAIT` * `ORIENTATION_LANDSCAPE` -## Paper Setup +## Options - `orientation`. Page orientation. `ORIENTATION_PORTRAIT` is default. * See constants above for possible values. - `paper`. Paper size. `A4` is default. @@ -15,17 +15,13 @@ - `pageSizeW`. Page width in *twip*. `11905.511811024` is default. - `pageSizeH`. Page height in *twip*. `16837.79527559` is default. - `gutter`. Page gutter spacing. `0` is default. - -## Section Setup - `headerHeight`. Spacing to top of header. `720` is default. - `footerHeight`. Spacing to bottom of footer. `720` is default. - `pageNumberingStart`. Starting page number. +- `colsNum`. Number of columns. `1` is default. +- `colsSpace`. Spacing between columns. `720` is default. - `breakType`. Section break type (`nextPage`, `nextColumn`, `continuous`, `evenPage`, `oddPage`). - `lineNumbering`. Line numbering. * See [`\PhpOffice\PhpWord\Style\LineNumbering`](/docs/usage/styles/linenumbering) for possible values. - `vAlign`. Vertical page alignment. * See [`\PhpOffice\PhpWord\SimpleType\VerticalJc`](/docs/usage/simpletypes/verticaljc) for possible values. - -## Columns -- `colsNum`. Number of columns. `1` is default. -- `colsSpace`. Spacing between columns. `720` is default. From a1b9125d5929dd47e63bdaf800bce9c9dddc8fdc Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 19:51:29 -0500 Subject: [PATCH 006/110] Update border.md --- docs/usage/styles/border.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/usage/styles/border.md b/docs/usage/styles/border.md index 54492a844c..f0112e689a 100644 --- a/docs/usage/styles/border.md +++ b/docs/usage/styles/border.md @@ -1,12 +1,6 @@ # Border -## Margins -- `marginTop`. Page margin top in *twip*. `1440` is default. -- `marginLeft`. Page margin left in *twip*. `1440` is default. -- `marginRight`. Page margin right in *twip*. `1440` is default. -- `marginBottom`. Page margin bottom in *twip*. `1440` is default. - -## Borders +## Options - `borderTopSize`. Border top size in *twip*. - `borderTopColor`. Border top color. - `borderTopStyle`. Border top style. @@ -19,3 +13,7 @@ - `borderBottomSize`. Border bottom size in *twip*. - `borderBottomColor`. Border bottom color. - `borderBottomStyle`. Border bottom style. +- `marginTop`. Page margin top in *twip*. `1440` is default. +- `marginLeft`. Page margin left in *twip*. `1440` is default. +- `marginRight`. Page margin right in *twip*. `1440` is default. +- `marginBottom`. Page margin bottom in *twip*. `1440` is default. From 5c441a8be06f31f9cadee78d0a7cad2555c86af5 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 19:51:50 -0500 Subject: [PATCH 007/110] Update section.md --- docs/usage/styles/section.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/usage/styles/section.md b/docs/usage/styles/section.md index 4ad6cd6def..9be8aff123 100644 --- a/docs/usage/styles/section.md +++ b/docs/usage/styles/section.md @@ -1,6 +1,6 @@ # Section - Extends Border - * See [`\PhpOffice\PhpWord\Style\Border`](/docs/usage/styles/border) for additional settings. + * See [`\PhpOffice\PhpWord\Style\Border`](/docs/usage/styles/border.md) for additional settings. ## Constants - Orientation @@ -11,7 +11,7 @@ - `orientation`. Page orientation. `ORIENTATION_PORTRAIT` is default. * See constants above for possible values. - `paper`. Paper size. `A4` is default. - * See [`\PhpOffice\PhpWord\Style\Paper`](/docs/usage/styles/paper) for possible values + * See [`\PhpOffice\PhpWord\Style\Paper`](/docs/usage/styles/paper.md) for possible values - `pageSizeW`. Page width in *twip*. `11905.511811024` is default. - `pageSizeH`. Page height in *twip*. `16837.79527559` is default. - `gutter`. Page gutter spacing. `0` is default. @@ -22,6 +22,6 @@ - `colsSpace`. Spacing between columns. `720` is default. - `breakType`. Section break type (`nextPage`, `nextColumn`, `continuous`, `evenPage`, `oddPage`). - `lineNumbering`. Line numbering. - * See [`\PhpOffice\PhpWord\Style\LineNumbering`](/docs/usage/styles/linenumbering) for possible values. + * See [`\PhpOffice\PhpWord\Style\LineNumbering`](/docs/usage/styles/linenumbering.md) for possible values. - `vAlign`. Vertical page alignment. - * See [`\PhpOffice\PhpWord\SimpleType\VerticalJc`](/docs/usage/simpletypes/verticaljc) for possible values. + * See [`\PhpOffice\PhpWord\SimpleType\VerticalJc`](/docs/usage/simpletypes/verticaljc.md) for possible values. From adf7111ff8dae310e2cbd169b3761f700378a90f Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 20:50:11 -0500 Subject: [PATCH 008/110] Update font.md --- docs/usage/styles/font.md | 68 +++++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 25 deletions(-) diff --git a/docs/usage/styles/font.md b/docs/usage/styles/font.md index 921dc7fd85..2785ea4a21 100644 --- a/docs/usage/styles/font.md +++ b/docs/usage/styles/font.md @@ -1,28 +1,46 @@ # Font -Available Font style options: +## Constants +- Underline + * `UNDERLINE_NONE` + * `ORIENTATION_DASH`, `ORIENTATION_DASHHEAVY`, `ORIENTATION_DASHLONG`, `ORIENTATION_DASHLONGHEAVY` + * `ORIENTATION_SINGLE`, `ORIENTATION_DOUBLE`, `ORIENTATION_HEAVY` + * `ORIENTATION_DOTDASH`, `ORIENTATION_DOTDASHHEAVY`, `ORIENTATION_DOTDOTDASH`, `ORIENTATION_DOTDOTDASHHEAVY` + * `ORIENTATION_DOTTED`, `ORIENTATION_DOTTEDHEAVY` + * `ORIENTATION_WAVY`, `ORIENTATION_WAVYDOUBLE`, `ORIENTATION_WAVYHEAVY` + * `ORIENTATION_WORDS` +- Foreground Color + * `FGCOLOR_YELLOW`, `FGCOLOR_LIGHTGREEN`, `FGCOLOR_CYAN`, `FGCOLOR_MAGENTA`, `FGCOLOR_BLUE`, `FGCOLOR_RED` + * `FGCOLOR_DARKBLUE`, `FGCOLOR_DARKCYAN`, `FGCOLOR_DARKGREEN`, `FGCOLOR_DARKMAGENTA`, `FGCOLOR_DARKRED`, `FGCOLOR_DARKYELLOW` + * `FGCOLOR_DARKGRAY`, `FGCOLOR_LIGHTGRAY`, `FGCOLOR_BLACK` -- ``allCaps``. All caps, *true* or *false*. -- ``bgColor``. Font background color, e.g. *FF0000*. -- ``bold``. Bold, *true* or *false*. -- ``color``. Font color, e.g. *FF0000*. -- ``doubleStrikethrough``. Double strikethrough, *true* or *false*. -- ``fgColor``. Font highlight color, e.g. *yellow*, *green*, *blue*. - See ``\PhpOffice\PhpWord\Style\Font::FGCOLOR_...`` class constants for possible values -- ``hint``. Font content type, *default*, *eastAsia*, or *cs*. -- ``italic``. Italic, *true* or *false*. -- ``name``. Font name, e.g. *Arial*. -- ``rtl``. Right to Left language, *true* or *false*. -- ``size``. Font size, e.g. *20*, *22*. -- ``smallCaps``. Small caps, *true* or *false*. -- ``strikethrough``. Strikethrough, *true* or *false*. -- ``subScript``. Subscript, *true* or *false*. -- ``superScript``. Superscript, *true* or *false*. -- ``underline``. Underline, *single*, *dash*, *dotted*, etc. - See ``\PhpOffice\PhpWord\Style\Font::UNDERLINE_...`` class constants for possible values -- ``lang``. Language, either a language code like *en-US*, *fr-BE*, etc. or an object (or as an array) if you need to set eastAsian or bidirectional languages - See ``\PhpOffice\PhpWord\Style\Language`` class for some language codes. -- ``position``. The text position, raised or lowered, in half points -- ``hidden``. Hidden text, *true* or *false*. -- ``whiteSpace``. How white space is handled when generating html/pdf. Possible values are *pre-wrap* and *normal* (other css values for white space are accepted, but are not expected to be useful). -- ``fallbackFont``. Fallback generic font for html/pdf. Possible values are *sans-serif*, *serif*, and *monospace* (other css values for generic fonts are accepted). +## Options +- `name`. Font name, e.g. *Arial*. +- `hint`. Font content type, *default*, *eastAsia*, or *cs*. +- `size`. Font size, e.g. *20*, *22*. +- `color`. Font color, e.g. *FF0000*. +- `bold`. Bold, *true* or *false*. +- `italic`. Italic, *true* or *false*. +- `underline`. Underline, *single*, *dash*, *dotted*, etc. `UNDERLINE_NONE` is default. + * See constants above for possible values. +- `superScript`. Superscript, *true* or *false*. +- `subScript`. Subscript, *true* or *false*. +- `strikethrough`. Strikethrough, *true* or *false*. +- `doubleStrikethrough`. Double strikethrough, *true* or *false*. +- `smallCaps`. Small caps, *true* or *false*. +- `allCaps`. All caps, *true* or *false*. +- `fgColor`. Font highlight color, e.g. *yellow*, *green*, *blue*. + * See constants above for possible values. +- `bgColor`. Font background color, e.g. *FF0000*. +- `scale`. Expande/compress text. +- `spacing`. Characters spacing adjustment in *twip*. +- `kerning`. Font kerning: halfpoint. +- `shading`. Shading. +- `rtl`. Right to Left language, *true* or *false*. +- `noproof`. Disable AutoCorrect, *true* or *false*. +- `lang`. Language, either a language code like *en-US*, *fr-BE*, etc. or an object (or as an array) if you need to set eastAsian or bidirectional languages + * See [`\PhpOffice\PhpWord\Style\Language`](/docs/usage/styles/language.md) class for some language codes. +- `hidden`. Hidden text, *true* or *false*. +- `position`. The text position, raised or lowered, in half points +- `whiteSpace`. How white space is handled when generating html/pdf. Possible values are *pre-wrap* and *normal* (other css values for white space are accepted, but are not expected to be useful). +- `fallbackFont`. Fallback generic font for html/pdf. Possible values are *sans-serif*, *serif*, and *monospace* (other css values for generic fonts are accepted). From bbdd022d3589923e2f177c411b097ba72153c6a8 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 20:53:47 -0500 Subject: [PATCH 009/110] Create language.md --- docs/usage/styles/language.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docs/usage/styles/language.md diff --git a/docs/usage/styles/language.md b/docs/usage/styles/language.md new file mode 100644 index 0000000000..6c4aca4e83 --- /dev/null +++ b/docs/usage/styles/language.md @@ -0,0 +1,13 @@ +# Language + +## Constants +- Languages + * `EN_US`, `EN_GB`, `FR_FR`, `FR_BE`, `FR_CH`, `ES_ES`, `DE_DE`, `DE_CH` + * `HE_IL`, `IT_IT`, `IT_CH`, `JA_JP`, `KO_KR`, `HI_IN`, `PT_BR`, `NL_NL` + * `SV_SE`, `UK_UA`, `RU_RU` + +## Options +- `langId`. Used for RTF document generation. +- `latin`. +- `eastAsia`. +- `bidirectional`. From 93710152c8d472fd03aaf06b6ce058ed3e23d01b Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 20:56:04 -0500 Subject: [PATCH 010/110] Update section.md --- docs/usage/styles/section.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/styles/section.md b/docs/usage/styles/section.md index 9be8aff123..e41d9c2f95 100644 --- a/docs/usage/styles/section.md +++ b/docs/usage/styles/section.md @@ -1,6 +1,6 @@ # Section - Extends Border - * See [`\PhpOffice\PhpWord\Style\Border`](/docs/usage/styles/border.md) for additional settings. + * See [`\PhpOffice\PhpWord\Style\Border`](/docs/usage/styles/border.md) for additional options. ## Constants - Orientation From d785bdb087b9f2009c70d4ef60d99d9d99b86893 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 21:32:26 -0500 Subject: [PATCH 011/110] Create verticaljc.md --- docs/usage/simpletype/verticaljc.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 docs/usage/simpletype/verticaljc.md diff --git a/docs/usage/simpletype/verticaljc.md b/docs/usage/simpletype/verticaljc.md new file mode 100644 index 0000000000..41847c7a8d --- /dev/null +++ b/docs/usage/simpletype/verticaljc.md @@ -0,0 +1,7 @@ +# VerticalJc + +## Constants +- `TOP`. +- `CENTER`. +- `BOTH`. +- `BOTTOM`. From f21038522a0be9d25413eb3c013ff6b7c2e08b8e Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 21:33:28 -0500 Subject: [PATCH 012/110] Rename verticaljc.md to verticaljc.md --- docs/usage/{simpletype => simpletypes}/verticaljc.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/usage/{simpletype => simpletypes}/verticaljc.md (100%) diff --git a/docs/usage/simpletype/verticaljc.md b/docs/usage/simpletypes/verticaljc.md similarity index 100% rename from docs/usage/simpletype/verticaljc.md rename to docs/usage/simpletypes/verticaljc.md From 5df8db768e9ca9e682d7819cef9b8d36a1e01eb0 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 21:38:31 -0500 Subject: [PATCH 013/110] Create linenumbering.md --- docs/usage/styles/linenumbering.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docs/usage/styles/linenumbering.md diff --git a/docs/usage/styles/linenumbering.md b/docs/usage/styles/linenumbering.md new file mode 100644 index 0000000000..7dec953bd9 --- /dev/null +++ b/docs/usage/styles/linenumbering.md @@ -0,0 +1,13 @@ +# LineNumbering + +## Constants + * `LINE_NUMBERING_CONTINUOUS` + * `LINE_NUMBERING_NEW_PAGE` + * `LINE_NUMBERING_NEW_SECTION` + +## Options +- `start`. Starting Value. `1` is default. +- `increment`. Increments. `1` is default. +- `distance`. Distance between text and line numbering in *twip*. +- `restart`. Line numbering restart setting. + * See constants above for possible values. From 3cf08940a2891462789f45a7032391384937ceda Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 21:56:51 -0500 Subject: [PATCH 014/110] Update paragraph.md --- docs/usage/styles/paragraph.md | 67 +++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index f51d5ba030..d80ded947d 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -1,29 +1,44 @@ # Paragraph +- Extends Border + * See [`\PhpOffice\PhpWord\Style\Border`](/docs/usage/styles/border.md) for additional options. -Available Paragraph style options: +## Constants +- Orientation + * `LINE_HEIGHT` = `240` + * `ORIENTATION_LANDSCAPE` -- ``alignment``. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012. - See ``\PhpOffice\PhpWord\SimpleType\Jc`` class constants for possible values. -- ``basedOn``. Parent style. -- ``hanging``. Hanging indentation in *half inches*. -- ``indent``. Indent (left indentation) in *half inches*. -- ``indentation``. An array of indentation key => value pairs in *twip*. Supports *left*, *right*, *firstLine*, *firstLineChars* and *hanging* indentation. - See ``\PhpOffice\PhpWord\Style\Indentation`` for possible identation types. -- ``keepLines``. Keep all lines on one page, *true* or *false*. -- ``keepNext``. Keep paragraph with next paragraph, *true* or *false*. -- ``lineHeight``. Text line height, e.g. *1.0*, *1.5*, etc. -- ``next``. Style for next paragraph. -- ``pageBreakBefore``. Start paragraph on next page, *true* or *false*. -- ``spaceBefore``. Space before paragraph in *twip*. -- ``spaceAfter``. Space after paragraph in *twip*. -- ``spacing``. Space between lines in *twip*. If spacingLineRule is auto, 240 (height of 1 line) will be added, so if you want a double line height, set this to 240. -- ``spacingLineRule``. Line Spacing Rule. *auto*, *exact*, *atLeast* - See ``\PhpOffice\PhpWord\SimpleType\LineSpacingRule`` class constants for possible values. -- ``suppressAutoHyphens``. Hyphenation for paragraph, *true* or *false*. -- ``tabs``. Set of custom tab stops. -- ``widowControl``. Allow first/last line to display on a separate page, *true* or *false*. -- ``contextualSpacing``. Ignore Spacing Above and Below When Using Identical Styles, *true* or *false*. -- ``bidi``. Right to Left Paragraph Layout, *true* or *false*. -- ``shading``. Paragraph Shading. -- ``textAlignment``. Vertical Character Alignment on Line. - See ``\PhpOffice\PhpWord\SimpleType\TextAlignment`` class constants for possible values. \ No newline at end of file +## Options +- `alignment`. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012. + * See [`\PhpOffice\PhpWord\SimpleType\Jc`](/docs/usage/simpletypes/jc.md) for possible values. +- `basedOn`. Parent style. +- `bidi`. Right to Left Paragraph Layout, *true* or *false*. +- `contextualSpacing`. Ignore Spacing Above and Below When Using Identical Styles, *true* or *false*. +- `hanging`. Hanging indentation in *half inches*. +- `indentation`. An array of indentation key => value pairs in *twip*. Supports *left*, *right*, *firstLine*, *firstLineChars* and *hanging* indentation. + See `\PhpOffice\PhpWord\Style\Indentation` for possible identation types. +- `indentHanging`. Hanging indentation in *half inches*. +- `indentFirstLine`. First line indentation in *half inches*. +- `indentFirstLineChars`. First line character indentation in *half inches*. +- `indentLeft`. Left indentation in *half inches*. +- `indentRight`. Right indentation in *half inches*. +- `keepLines`. Keep all lines on one page, *true* or *false*. +- `keepNext`. Keep paragraph with next paragraph, *true* or *false*. +- `lineHeight`. Text line height, e.g. *1.0*, *1.5*, etc. +- `next`. Style for next paragraph. +- `numLevel`. Numbering level. `0` is default. +- `numStyle`. Numbering style name + * See [`\PhpOffice\PhpWord\Style\Numnbering`](/docs/usage/styles/numbering.md). +- `pageBreakBefore`. Start paragraph on next page, *true* or *false*. +- `shading`. Paragraph Shading. +- `spaceAfter`. Space after paragraph in *twip*. +- `spaceBefore`. Space before paragraph in *twip*. +- `spacing`. Space between lines in *twip*. If spacingLineRule is auto, 240 (height of 1 line) will be added, so if you want a double line height, set this to 240. + * See [`\PhpOffice\PhpWord\SimpleType\LineSpacingRule`](/docs/usage/simpletype/linespacingrule.md) class constants for possible values. +- `spacingLineRule`. Line Spacing Rule. *auto*, *exact*, *atLeast* + * See [`\PhpOffice\PhpWord\SimpleType\LineSpacingRule`](/docs/usage/simpletype/linespacingrule.md) class constants for possible values. +- `suppressAutoHyphens`. Hyphenation for paragraph, *true* or *false*. +- `tabs`. Set of custom tab stops. + * See [`\PhpOffice\PhpWord\Style\Tab`](/docs/usage/styles/tabs.md). +- `widowControl`. Allow first/last line to display on a separate page, *true* or *false*. +- `textAlignment`. Vertical Character Alignment on Line. + * See [`\PhpOffice\PhpWord\SimpleType\TextAlignment`](/docs/usage/simpletypes/textalignment.md) class constants for possible values. From 25ec006809b8f721d377bc085a09b5574a1e910c Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:02:25 -0500 Subject: [PATCH 015/110] Update section.md --- docs/usage/styles/section.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/usage/styles/section.md b/docs/usage/styles/section.md index e41d9c2f95..1cb3833d6e 100644 --- a/docs/usage/styles/section.md +++ b/docs/usage/styles/section.md @@ -8,20 +8,20 @@ * `ORIENTATION_LANDSCAPE` ## Options -- `orientation`. Page orientation. `ORIENTATION_PORTRAIT` is default. - * See constants above for possible values. -- `paper`. Paper size. `A4` is default. - * See [`\PhpOffice\PhpWord\Style\Paper`](/docs/usage/styles/paper.md) for possible values -- `pageSizeW`. Page width in *twip*. `11905.511811024` is default. -- `pageSizeH`. Page height in *twip*. `16837.79527559` is default. -- `gutter`. Page gutter spacing. `0` is default. -- `headerHeight`. Spacing to top of header. `720` is default. -- `footerHeight`. Spacing to bottom of footer. `720` is default. -- `pageNumberingStart`. Starting page number. +- `breakType`. Section break type (`nextPage`, `nextColumn`, `continuous`, `evenPage`, `oddPage`). - `colsNum`. Number of columns. `1` is default. - `colsSpace`. Spacing between columns. `720` is default. -- `breakType`. Section break type (`nextPage`, `nextColumn`, `continuous`, `evenPage`, `oddPage`). +- `footerHeight`. Spacing to bottom of footer. `720` is default. +- `gutter`. Page gutter spacing. `0` is default. +- `headerHeight`. Spacing to top of header. `720` is default. - `lineNumbering`. Line numbering. * See [`\PhpOffice\PhpWord\Style\LineNumbering`](/docs/usage/styles/linenumbering.md) for possible values. +- `orientation`. Page orientation. `ORIENTATION_PORTRAIT` is default. + * See constants above for possible values. +- `pageNumberingStart`. Starting page number. +- `pageSizeH`. Page height in *twip*. `16837.79527559` is default. +- `pageSizeW`. Page width in *twip*. `11905.511811024` is default. +- `paperSize`. Paper size. `A4` is default. + * See [`\PhpOffice\PhpWord\Style\Paper`](/docs/usage/styles/paper.md) for possible values - `vAlign`. Vertical page alignment. * See [`\PhpOffice\PhpWord\SimpleType\VerticalJc`](/docs/usage/simpletypes/verticaljc.md) for possible values. From 0c6c30e3874d29db3bdb6a798d73be71189dccc5 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:05:37 -0500 Subject: [PATCH 016/110] Update paper.md --- docs/usage/styles/paper.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/usage/styles/paper.md b/docs/usage/styles/paper.md index 571504c48d..9ccae0c5bd 100644 --- a/docs/usage/styles/paper.md +++ b/docs/usage/styles/paper.md @@ -8,5 +8,3 @@ ## Options - `size`. Page size. `A4` is default. * See sizes above for possible values. -- `width`. Page width in *twip*. -- `height`. Page height in *twip*. From 0826e80a5dd99fafd0dea49a288de4d3d6ea7b59 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:10:52 -0500 Subject: [PATCH 017/110] Update font.md --- docs/usage/styles/font.md | 43 +++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/docs/usage/styles/font.md b/docs/usage/styles/font.md index 2785ea4a21..c94f45c74d 100644 --- a/docs/usage/styles/font.md +++ b/docs/usage/styles/font.md @@ -15,32 +15,35 @@ * `FGCOLOR_DARKGRAY`, `FGCOLOR_LIGHTGRAY`, `FGCOLOR_BLACK` ## Options -- `name`. Font name, e.g. *Arial*. -- `hint`. Font content type, *default*, *eastAsia*, or *cs*. -- `size`. Font size, e.g. *20*, *22*. -- `color`. Font color, e.g. *FF0000*. +- `allCaps`. All caps, *true* or *false*. +- `bgColor`. Font background color, e.g. *FF0000*. - `bold`. Bold, *true* or *false*. -- `italic`. Italic, *true* or *false*. -- `underline`. Underline, *single*, *dash*, *dotted*, etc. `UNDERLINE_NONE` is default. - * See constants above for possible values. -- `superScript`. Superscript, *true* or *false*. -- `subScript`. Subscript, *true* or *false*. -- `strikethrough`. Strikethrough, *true* or *false*. +- `color`. Font color, e.g. *FF0000*. - `doubleStrikethrough`. Double strikethrough, *true* or *false*. -- `smallCaps`. Small caps, *true* or *false*. -- `allCaps`. All caps, *true* or *false*. +- `fallbackFont`. Fallback generic font for html/pdf. Possible values are *sans-serif*, *serif*, and *monospace* (other css values for generic fonts are accepted). - `fgColor`. Font highlight color, e.g. *yellow*, *green*, *blue*. * See constants above for possible values. -- `bgColor`. Font background color, e.g. *FF0000*. -- `scale`. Expande/compress text. -- `spacing`. Characters spacing adjustment in *twip*. +- `hidden`. Hidden text, *true* or *false*. +- `hint`. Font content type, *default*, *eastAsia*, or *cs*. +- `italic`. Italic, *true* or *false*. - `kerning`. Font kerning: halfpoint. -- `shading`. Shading. -- `rtl`. Right to Left language, *true* or *false*. -- `noproof`. Disable AutoCorrect, *true* or *false*. - `lang`. Language, either a language code like *en-US*, *fr-BE*, etc. or an object (or as an array) if you need to set eastAsian or bidirectional languages * See [`\PhpOffice\PhpWord\Style\Language`](/docs/usage/styles/language.md) class for some language codes. -- `hidden`. Hidden text, *true* or *false*. +- `lineHeight`. Line height. +- `paragraph`. Paragraph. + * See [`\PhpOffice\PhpWord\Style\Paragraph`](/docs/usage/styles/paragraph.md). +- `name`. Font name, e.g. *Arial*. +- `noProof`. Disable AutoCorrect, *true* or *false*. - `position`. The text position, raised or lowered, in half points +- `rtl`. Right to Left language, *true* or *false*. +- `scale`. Expande/compress text. +- `shading`. Shading. +- `size`. Font size, e.g. *20*, *22*. +- `smallCaps`. Small caps, *true* or *false*. +- `spacing`. Characters spacing adjustment in *twip*. +- `strikethrough`. Strikethrough, *true* or *false*. +- `subScript`. Subscript, *true* or *false*. +- `superScript`. Superscript, *true* or *false*. +- `underline`. Underline, *single*, *dash*, *dotted*, etc. `UNDERLINE_NONE` is default. + * See constants above for possible values. - `whiteSpace`. How white space is handled when generating html/pdf. Possible values are *pre-wrap* and *normal* (other css values for white space are accepted, but are not expected to be useful). -- `fallbackFont`. Fallback generic font for html/pdf. Possible values are *sans-serif*, *serif*, and *monospace* (other css values for generic fonts are accepted). From 64ef4b92932f260578fe5f548ead34e0ebdd7d1a Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:15:17 -0500 Subject: [PATCH 018/110] Create jc.md --- docs/usage/simpletypes/jc.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docs/usage/simpletypes/jc.md diff --git a/docs/usage/simpletypes/jc.md b/docs/usage/simpletypes/jc.md new file mode 100644 index 0000000000..a80117c068 --- /dev/null +++ b/docs/usage/simpletypes/jc.md @@ -0,0 +1,13 @@ +# Jc + +## Constants +- `START`. Commonly known as *left*. +- `CENTER`. +- `END`. Commonly known as *right*. +- `BOTH`. Commonly known as *justify*. +- `MEDIUM_KASHIDA`. +- `DISTRIBUTE`. +- `NUM_TAB`. +- `HIGH_KASHIDA`. +- `LOW_KASHIDA`. +- `THAI_DISTRIBUTE`. From 80b9fd91ad1f06633d091c4ae0d969a57d82a37a Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:16:22 -0500 Subject: [PATCH 019/110] Create linespacingrule.md --- docs/usage/simpletypes/linespacingrule.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 docs/usage/simpletypes/linespacingrule.md diff --git a/docs/usage/simpletypes/linespacingrule.md b/docs/usage/simpletypes/linespacingrule.md new file mode 100644 index 0000000000..56b155cbe5 --- /dev/null +++ b/docs/usage/simpletypes/linespacingrule.md @@ -0,0 +1,6 @@ +# LineSpacingRule + +## Constants +- `AUTO`. +- `EXACT`. +- `AT_LEAST`. From f2937deba66117ceeedc1a7b4354e205c3891db1 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:33:29 -0500 Subject: [PATCH 020/110] Create numberformat.md --- docs/usage/simpletypes/numberformat.md | 63 ++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 docs/usage/simpletypes/numberformat.md diff --git a/docs/usage/simpletypes/numberformat.md b/docs/usage/simpletypes/numberformat.md new file mode 100644 index 0000000000..351d8414e2 --- /dev/null +++ b/docs/usage/simpletypes/numberformat.md @@ -0,0 +1,63 @@ +# NumberFormat + +## Constants +- `NONE`. No Numbering. +- `BULLET`. Bullet. +- `DECIMAL`. Decimal Numbers. +- `UPPER_ROMAN`. Uppercase Roman Numerals. +- `LOWER_ROMAN`. Lowercase Roman Numerals. +- `UPPER_LETTER`. Uppercase Latin Alphabet. +- `LOWER_LETTER`. Lowercase Latin Alphabet. +- `ORDINAL`. Ordinal. +- `ORDINAL_TEXT`. Ordinal Text. +- `CARDINAL_TEXT`. Cardinal Text. +- `HEX`. Hexadecimal Numbering. +- `CHICAGO`. Chicago Manual of Style. +- `NUMBER_IN_DASH`. Number With Dashes. +- `DECIMAL_ZERO`. Initial Zero Arabic Numerals. +- `DECIMAL_FULL_WIDTH`. Double Byte Arabic Numerals. +- `DECIMAL_FULL_WIDTH2`. Double Byte Arabic Numerals Alternate. +- `DECIMAL_HALF_WIDTH`. Single Byte Arabic Numerals. +- `DECIMAL_ENCLOSED_CIRCLE`. Decimal Numbers Enclosed in a Circle. +- `DECIMAL_ENCLOSED_FULL_STOP`. Decimal Numbers Followed by a Period. +- `DECIMAL_ENCLOSED_PAREN`. Decimal Numbers Enclosed in Parenthesis. +- `DECIMAL_ENCLOSED_CIRCLE_CHINESE`. Decimal Numbers Enclosed in a Circle. +- `IDEOGRAPH_DIGITAL`. Ideographs. +- `IDEOGRAPHENCLOSEDCIRCLE`. Ideographs Enclosed in a Circle. +- `IDEOGRAPH_TRADITIONAL`. Traditional Ideograph Format. +- `IDEOGRAPH_ZODIAC`. Zodiac Ideograph Format. +- `IDEOGRAPH_ZODIAC_TRADITIONAL`. Traditional Zodiac Ideograph Format. +- `IDEOGRAPH_LEGAL_TRADITIONAL`. Traditional Legal Ideograph Format. +- `AIUEO`. AIUEO Order Hiragana. +- `AIUEO_FULL_WIDTH`. Full-Width AIUEO Order Hiragana. +- `IROHA`. Iroha Ordered Katakana. +- `IROHA_FULL_WIDTH `. Full-Width Iroha Ordered Katakana. +- `JAPANESE_COUNTING`. Japanese Counting System. +- `JAPANESE_LEGAL`. Japanese Legal Numbering. +- `JAPANESE_DIGITAL_TEN_THOUSAND`. Japanese Digital Ten Thousand Counting System. +- `CHINESE_COUNTING`. Chinese Counting System. +- `CHINESE_LEGAL_SIMPLIFIED`. Chinese Legal Simplified Format. +- `CHINESE_COUNTING_THOUSAND`. Chinese Counting Thousand System. +- `GANADA`. Korean Ganada Numbering. +- `CHOSUNG`. Korean Chosung Numbering. +- `KOREAN_DIGITAL`. Korean Digital Counting System. +- `KOREAN_COUNTING`. Korean Counting System. +- `KOREAN_LEGAL`. Korean Legal Numbering. +- `KOREAN_DIGITAL2`. Korean Digital Counting System Alternate. +- `VIETNAMESE_COUNTING`. Vietnamese Numerals. +- `RUSSIAN_LOWER`. Lowercase Russian Alphabet. +- `RUSSIAN_UPPER`. Uppercase Russian Alphabet. +- `HEBREW1`. Hebrew Numerals. +- `HEBREW2`. Hebrew Alphabet. +- `ARABIC_ALPHA`. Arabic Alphabet. +- `ARABIC_ABJAD`. Arabic Abjad Numerals. +- `HINDI_VOWELS`. Hindi Vowels. +- `HINDI_CONSONANTS`. Hindi Consonants. +- `HINDI_NUMBERS`. Hindi Numbers. +- `HINDI_COUNTING`. Hindi Counting System. +- `THAI_LETTERS`. Thai Letters. +- `THAI_NUMBERS`. Thai Numerals. +- `THAI_COUNTING`. Thai Counting System. +- `TAIWANESE_COUNTING`. Taiwanese Counting System. +- `TAIWANESE_COUNTING_THOUSAND`. Taiwanese Counting Thousand System. +- `TAIWANESE_DIGITAL`. Taiwanese Digital Counting System. From 432b1ccda4bf52890ecc4267de7cd7cfca87bb6e Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:35:09 -0500 Subject: [PATCH 021/110] Update paragraph.md --- docs/usage/styles/paragraph.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index d80ded947d..2620591547 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -27,7 +27,7 @@ - `next`. Style for next paragraph. - `numLevel`. Numbering level. `0` is default. - `numStyle`. Numbering style name - * See [`\PhpOffice\PhpWord\Style\Numnbering`](/docs/usage/styles/numbering.md). + * See [`\PhpOffice\PhpWord\Style\Numbering`](/docs/usage/styles/numbering.md). - `pageBreakBefore`. Start paragraph on next page, *true* or *false*. - `shading`. Paragraph Shading. - `spaceAfter`. Space after paragraph in *twip*. From 62364ba014a918fa09a467717d7b9f321dd9167a Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:40:00 -0500 Subject: [PATCH 022/110] Update border.md --- docs/usage/styles/border.md | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/docs/usage/styles/border.md b/docs/usage/styles/border.md index f0112e689a..bc553bd6cd 100644 --- a/docs/usage/styles/border.md +++ b/docs/usage/styles/border.md @@ -1,19 +1,8 @@ # Border ## Options -- `borderTopSize`. Border top size in *twip*. -- `borderTopColor`. Border top color. -- `borderTopStyle`. Border top style. -- `borderLeftSize`. Border left size in *twip*. -- `borderLeftColor`. Border left color. -- `borderLeftStyle`. Border left style. -- `borderRightSize`. Border right size in *twip*. -- `borderRightColor`. Border right color. -- `borderRightStyle`. Border right style. -- `borderBottomSize`. Border bottom size in *twip*. -- `borderBottomColor`. Border bottom color. -- `borderBottomStyle`. Border bottom style. -- `marginTop`. Page margin top in *twip*. `1440` is default. -- `marginLeft`. Page margin left in *twip*. `1440` is default. -- `marginRight`. Page margin right in *twip*. `1440` is default. -- `marginBottom`. Page margin bottom in *twip*. `1440` is default. +- `border(Top|Right|Bottom|Left)Size`. Border size in *twip*. +- `border(Top|Right|Bottom|Left)Color`. Border color, eg '9966CC'. +- `border(Top|Right|Bottom|Left)Style`. Border style. + * See [`\PhpOffice\PhpWord\SimpleType\Border`](/docs/usage/simpletype/border.md) class constants for possible values. +- `margin(Top|Right|Bottom|Left)`. Page margin in *twip*. `1440` is default. From 6488aeb25ffd8a36f372bb27f5fc58ffb7b88ff8 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:43:26 -0500 Subject: [PATCH 023/110] Create border.md --- docs/usage/simpletypes/border.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 docs/usage/simpletypes/border.md diff --git a/docs/usage/simpletypes/border.md b/docs/usage/simpletypes/border.md new file mode 100644 index 0000000000..3f69e26d39 --- /dev/null +++ b/docs/usage/simpletypes/border.md @@ -0,0 +1,30 @@ +# Border + +## Constants +- `SINGLE`. A single line. +- `DASH_DOT_STROKED`. A line with a series of alternating thin and thick strokes +- `DASHED`. A dashed line +- `DASH_SMALL_GAP`. A dashed line with small gaps +- `DOT_DASH`. A line with alternating dots and dashes +- `DOT_DOT_DASH`. A line with a repeating dot - dot - dash sequence +- `DOTTED`. A dotted line +- `DOUBLE`. A double line +- `DOUBLE_WAVE`. A double wavy line +- `INSET`. An inset set of lines +- `NIL`. No border +- `NONE`. No border +- `OUTSET`. An outset set of lines +- `THICK`. A single line +- `THICK_THIN_LARGE_GAP`. A thick line contained within a thin line with a large-sized intermediate gap +- `THICK_THIN_MEDIUM_GAP`. A thick line contained within a thin line with a medium-sized intermediate gap +- `THICK_THIN_SMALL_GAP`. A thick line contained within a thin line with a small intermediate gap +- `THIN_THICK_LARGE_GAP`. A thin line contained within a thick line with a large-sized intermediate gap +- `THIN_THICK_MEDIUM_GAP`. A thick line contained within a thin line with a medium-sized intermediate gap +- `THIN_THICK_SMALL_GAP`. A thick line contained within a thin line with a small intermediate gap +- `THIN_THICK_THINLARGE_GAP`. A thin-thick-thin line with a large gap +- `THIN_THICK_THIN_MEDIUM_GAP`. A thin-thick-thin line with a medium gap +- `THIN_THICK_THIN_SMALL_GAP`. A thin-thick-thin line with a small gap +- `THREE_D_EMBOSS`. A three-staged gradient line, getting darker towards the paragraph +- `THREE_D_ENGRAVE`. A three-staged gradient like, getting darker away from the paragraph +- `TRIPLE`. A triple line +- `WAVE`. A wavy line From 10b6a4b9ed890a895eb2ac25aaf4d914d32412c1 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:43:52 -0500 Subject: [PATCH 024/110] Update border.md --- docs/usage/styles/border.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/styles/border.md b/docs/usage/styles/border.md index bc553bd6cd..b7e7dabfff 100644 --- a/docs/usage/styles/border.md +++ b/docs/usage/styles/border.md @@ -4,5 +4,5 @@ - `border(Top|Right|Bottom|Left)Size`. Border size in *twip*. - `border(Top|Right|Bottom|Left)Color`. Border color, eg '9966CC'. - `border(Top|Right|Bottom|Left)Style`. Border style. - * See [`\PhpOffice\PhpWord\SimpleType\Border`](/docs/usage/simpletype/border.md) class constants for possible values. + * See [`\PhpOffice\PhpWord\SimpleType\Border`](/docs/usage/simpletypes/border.md) class constants for possible values. - `margin(Top|Right|Bottom|Left)`. Page margin in *twip*. `1440` is default. From 875bedee191db9599a9cb3f458df2bf93e97afc4 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:45:06 -0500 Subject: [PATCH 025/110] Update font.md --- docs/usage/styles/font.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/usage/styles/font.md b/docs/usage/styles/font.md index c94f45c74d..7546c8e0ef 100644 --- a/docs/usage/styles/font.md +++ b/docs/usage/styles/font.md @@ -3,12 +3,12 @@ ## Constants - Underline * `UNDERLINE_NONE` - * `ORIENTATION_DASH`, `ORIENTATION_DASHHEAVY`, `ORIENTATION_DASHLONG`, `ORIENTATION_DASHLONGHEAVY` - * `ORIENTATION_SINGLE`, `ORIENTATION_DOUBLE`, `ORIENTATION_HEAVY` - * `ORIENTATION_DOTDASH`, `ORIENTATION_DOTDASHHEAVY`, `ORIENTATION_DOTDOTDASH`, `ORIENTATION_DOTDOTDASHHEAVY` - * `ORIENTATION_DOTTED`, `ORIENTATION_DOTTEDHEAVY` - * `ORIENTATION_WAVY`, `ORIENTATION_WAVYDOUBLE`, `ORIENTATION_WAVYHEAVY` - * `ORIENTATION_WORDS` + * `UNDERLINE_DASH`, `UNDERLINE_DASHHEAVY`, `UNDERLINE_DASHLONG`, `UNDERLINE_DASHLONGHEAVY` + * `UNDERLINE_SINGLE`, `UNDERLINE_DOUBLE`, `UNDERLINE_HEAVY` + * `UNDERLINE_DOTDASH`, `UNDERLINE_DOTDASHHEAVY`, `UNDERLINE_DOTDOTDASH`, `UNDERLINE_DOTDOTDASHHEAVY` + * `UNDERLINE_DOTTED`, `UNDERLINE_DOTTEDHEAVY` + * `UNDERLINE_WAVY`, `UNDERLINE_WAVYDOUBLE`, `UNDERLINE_WAVYHEAVY` + * `UNDERLINE_WORDS` - Foreground Color * `FGCOLOR_YELLOW`, `FGCOLOR_LIGHTGREEN`, `FGCOLOR_CYAN`, `FGCOLOR_MAGENTA`, `FGCOLOR_BLUE`, `FGCOLOR_RED` * `FGCOLOR_DARKBLUE`, `FGCOLOR_DARKCYAN`, `FGCOLOR_DARKGREEN`, `FGCOLOR_DARKMAGENTA`, `FGCOLOR_DARKRED`, `FGCOLOR_DARKYELLOW` From 4e1c2042cf39e6846f03a013444f36ac9689de63 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:45:26 -0500 Subject: [PATCH 026/110] Update font.md --- docs/usage/styles/font.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/usage/styles/font.md b/docs/usage/styles/font.md index 7546c8e0ef..c97aadab80 100644 --- a/docs/usage/styles/font.md +++ b/docs/usage/styles/font.md @@ -5,7 +5,8 @@ * `UNDERLINE_NONE` * `UNDERLINE_DASH`, `UNDERLINE_DASHHEAVY`, `UNDERLINE_DASHLONG`, `UNDERLINE_DASHLONGHEAVY` * `UNDERLINE_SINGLE`, `UNDERLINE_DOUBLE`, `UNDERLINE_HEAVY` - * `UNDERLINE_DOTDASH`, `UNDERLINE_DOTDASHHEAVY`, `UNDERLINE_DOTDOTDASH`, `UNDERLINE_DOTDOTDASHHEAVY` + * `UNDERLINE_DOTDASH`, `UNDERLINE_DOTDASHHEAVY` + * `UNDERLINE_DOTDOTDASH`, `UNDERLINE_DOTDOTDASHHEAVY` * `UNDERLINE_DOTTED`, `UNDERLINE_DOTTEDHEAVY` * `UNDERLINE_WAVY`, `UNDERLINE_WAVYDOUBLE`, `UNDERLINE_WAVYHEAVY` * `UNDERLINE_WORDS` From 85eafed430129a1acdcb8b7e9b1896d22302e1bc Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:46:39 -0500 Subject: [PATCH 027/110] Update paragraph.md --- docs/usage/styles/paragraph.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index 2620591547..782dba5466 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -15,7 +15,7 @@ - `contextualSpacing`. Ignore Spacing Above and Below When Using Identical Styles, *true* or *false*. - `hanging`. Hanging indentation in *half inches*. - `indentation`. An array of indentation key => value pairs in *twip*. Supports *left*, *right*, *firstLine*, *firstLineChars* and *hanging* indentation. - See `\PhpOffice\PhpWord\Style\Indentation` for possible identation types. + * See [`\PhpOffice\PhpWord\Style\Indentation`](/docs/usage/styles/indentation.md) for possible identation types. - `indentHanging`. Hanging indentation in *half inches*. - `indentFirstLine`. First line indentation in *half inches*. - `indentFirstLineChars`. First line character indentation in *half inches*. From 54cb4debffd9fa0ec95faef5a78e315258f26814 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:47:18 -0500 Subject: [PATCH 028/110] Update paragraph.md --- docs/usage/styles/paragraph.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index 782dba5466..f4a4c979b4 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -33,9 +33,9 @@ - `spaceAfter`. Space after paragraph in *twip*. - `spaceBefore`. Space before paragraph in *twip*. - `spacing`. Space between lines in *twip*. If spacingLineRule is auto, 240 (height of 1 line) will be added, so if you want a double line height, set this to 240. - * See [`\PhpOffice\PhpWord\SimpleType\LineSpacingRule`](/docs/usage/simpletype/linespacingrule.md) class constants for possible values. + * See [`\PhpOffice\PhpWord\SimpleType\LineSpacingRule`](/docs/usage/simpletypes/linespacingrule.md) class constants for possible values. - `spacingLineRule`. Line Spacing Rule. *auto*, *exact*, *atLeast* - * See [`\PhpOffice\PhpWord\SimpleType\LineSpacingRule`](/docs/usage/simpletype/linespacingrule.md) class constants for possible values. + * See [`\PhpOffice\PhpWord\SimpleType\LineSpacingRule`](/docs/usage/simpletypes/linespacingrule.md) class constants for possible values. - `suppressAutoHyphens`. Hyphenation for paragraph, *true* or *false*. - `tabs`. Set of custom tab stops. * See [`\PhpOffice\PhpWord\Style\Tab`](/docs/usage/styles/tabs.md). From 646427366341210ef0d7a5b88d3e7938698ee176 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:47:53 -0500 Subject: [PATCH 029/110] Update paragraph.md --- docs/usage/styles/paragraph.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index f4a4c979b4..e279bda728 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -33,7 +33,6 @@ - `spaceAfter`. Space after paragraph in *twip*. - `spaceBefore`. Space before paragraph in *twip*. - `spacing`. Space between lines in *twip*. If spacingLineRule is auto, 240 (height of 1 line) will be added, so if you want a double line height, set this to 240. - * See [`\PhpOffice\PhpWord\SimpleType\LineSpacingRule`](/docs/usage/simpletypes/linespacingrule.md) class constants for possible values. - `spacingLineRule`. Line Spacing Rule. *auto*, *exact*, *atLeast* * See [`\PhpOffice\PhpWord\SimpleType\LineSpacingRule`](/docs/usage/simpletypes/linespacingrule.md) class constants for possible values. - `suppressAutoHyphens`. Hyphenation for paragraph, *true* or *false*. From 2887f3a2f6f79607d5193a3bf3dbd40c96b07006 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:48:49 -0500 Subject: [PATCH 030/110] Update jc.md --- docs/usage/simpletypes/jc.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/usage/simpletypes/jc.md b/docs/usage/simpletypes/jc.md index a80117c068..5ade045fd4 100644 --- a/docs/usage/simpletypes/jc.md +++ b/docs/usage/simpletypes/jc.md @@ -11,3 +11,8 @@ - `HIGH_KASHIDA`. - `LOW_KASHIDA`. - `THAI_DISTRIBUTE`. + +Depricated +- `LEFT`. +- `RIGHT`. +- `JUSTIFY`. From 0388576e18d10c2d3a62ec6df5ffac3bcf43bf8c Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:49:06 -0500 Subject: [PATCH 031/110] Update jc.md --- docs/usage/simpletypes/jc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/simpletypes/jc.md b/docs/usage/simpletypes/jc.md index 5ade045fd4..e56f36758b 100644 --- a/docs/usage/simpletypes/jc.md +++ b/docs/usage/simpletypes/jc.md @@ -12,7 +12,7 @@ - `LOW_KASHIDA`. - `THAI_DISTRIBUTE`. -Depricated +Deprecated - `LEFT`. - `RIGHT`. - `JUSTIFY`. From 8f7a376a697a50f366080b662fdd5be8ffab8e19 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:49:27 -0500 Subject: [PATCH 032/110] Update jc.md --- docs/usage/simpletypes/jc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/simpletypes/jc.md b/docs/usage/simpletypes/jc.md index e56f36758b..a16574107a 100644 --- a/docs/usage/simpletypes/jc.md +++ b/docs/usage/simpletypes/jc.md @@ -1,4 +1,4 @@ -# Jc +# Justification ## Constants - `START`. Commonly known as *left*. From 11e297fb7ad312af8c0eaac038514abdc5bbe691 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:49:37 -0500 Subject: [PATCH 033/110] Update verticaljc.md --- docs/usage/simpletypes/verticaljc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/simpletypes/verticaljc.md b/docs/usage/simpletypes/verticaljc.md index 41847c7a8d..c2ee6859f7 100644 --- a/docs/usage/simpletypes/verticaljc.md +++ b/docs/usage/simpletypes/verticaljc.md @@ -1,4 +1,4 @@ -# VerticalJc +# Vertical Justification ## Constants - `TOP`. From 3b27b766e932b62748dca89a204681e24811863d Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:49:52 -0500 Subject: [PATCH 034/110] Update border.md --- docs/usage/simpletypes/border.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/simpletypes/border.md b/docs/usage/simpletypes/border.md index 3f69e26d39..225904ab2b 100644 --- a/docs/usage/simpletypes/border.md +++ b/docs/usage/simpletypes/border.md @@ -1,4 +1,4 @@ -# Border +# Border Type ## Constants - `SINGLE`. A single line. From b6968af0970bed524cf8128f1289abcad940e379 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:50:06 -0500 Subject: [PATCH 035/110] Update border.md --- docs/usage/simpletypes/border.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/simpletypes/border.md b/docs/usage/simpletypes/border.md index 225904ab2b..e0c6092c55 100644 --- a/docs/usage/simpletypes/border.md +++ b/docs/usage/simpletypes/border.md @@ -1,4 +1,4 @@ -# Border Type +# Border Style ## Constants - `SINGLE`. A single line. From 5271029475cef57f47a64843229fc8c9b1292331 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:50:15 -0500 Subject: [PATCH 036/110] Update numberformat.md --- docs/usage/simpletypes/numberformat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/simpletypes/numberformat.md b/docs/usage/simpletypes/numberformat.md index 351d8414e2..27e5b7278d 100644 --- a/docs/usage/simpletypes/numberformat.md +++ b/docs/usage/simpletypes/numberformat.md @@ -1,4 +1,4 @@ -# NumberFormat +# Number Format ## Constants - `NONE`. No Numbering. From fbb19e8b9bb94689bf3424fce826c4b0be6ad5e3 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:50:31 -0500 Subject: [PATCH 037/110] Update linespacingrule.md --- docs/usage/simpletypes/linespacingrule.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/simpletypes/linespacingrule.md b/docs/usage/simpletypes/linespacingrule.md index 56b155cbe5..79e891386b 100644 --- a/docs/usage/simpletypes/linespacingrule.md +++ b/docs/usage/simpletypes/linespacingrule.md @@ -1,4 +1,4 @@ -# LineSpacingRule +# Line Spacing Rule ## Constants - `AUTO`. From 73f7cb2d281c859df43f03745702416cb1060a3d Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:50:50 -0500 Subject: [PATCH 038/110] Update linenumbering.md --- docs/usage/styles/linenumbering.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/styles/linenumbering.md b/docs/usage/styles/linenumbering.md index 7dec953bd9..c68a81b217 100644 --- a/docs/usage/styles/linenumbering.md +++ b/docs/usage/styles/linenumbering.md @@ -1,4 +1,4 @@ -# LineNumbering +# Line Numbering ## Constants * `LINE_NUMBERING_CONTINUOUS` From 48da57908d06b6b072c26ad2b91a0b5e74213dca Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 22:56:55 -0500 Subject: [PATCH 039/110] Update paragraph.md --- docs/usage/styles/paragraph.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index e279bda728..e94764b447 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -3,9 +3,7 @@ * See [`\PhpOffice\PhpWord\Style\Border`](/docs/usage/styles/border.md) for additional options. ## Constants -- Orientation - * `LINE_HEIGHT` = `240` - * `ORIENTATION_LANDSCAPE` +- `LINE_HEIGHT` = `240` ## Options - `alignment`. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012. From 8d80a0b7d9c6d35283fa746f11380b7c3c65c059 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 23:06:55 -0500 Subject: [PATCH 040/110] Update section.md --- docs/usage/styles/section.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/usage/styles/section.md b/docs/usage/styles/section.md index 1cb3833d6e..658bb8ca31 100644 --- a/docs/usage/styles/section.md +++ b/docs/usage/styles/section.md @@ -1,6 +1,4 @@ -# Section -- Extends Border - * See [`\PhpOffice\PhpWord\Style\Border`](/docs/usage/styles/border.md) for additional options. +# Section Styles ## Constants - Orientation @@ -15,13 +13,15 @@ - `gutter`. Page gutter spacing. `0` is default. - `headerHeight`. Spacing to top of header. `720` is default. - `lineNumbering`. Line numbering. - * See [`\PhpOffice\PhpWord\Style\LineNumbering`](/docs/usage/styles/linenumbering.md) for possible values. + * See [`Style > LineNumbering`](/docs/usage/styles/linenumbering.md) for possible values. - `orientation`. Page orientation. `ORIENTATION_PORTRAIT` is default. * See constants above for possible values. - `pageNumberingStart`. Starting page number. - `pageSizeH`. Page height in *twip*. `16837.79527559` is default. - `pageSizeW`. Page width in *twip*. `11905.511811024` is default. - `paperSize`. Paper size. `A4` is default. - * See [`\PhpOffice\PhpWord\Style\Paper`](/docs/usage/styles/paper.md) for possible values + * See [`Style > Paper`](/docs/usage/styles/paper.md) for possible values - `vAlign`. Vertical page alignment. - * See [`\PhpOffice\PhpWord\SimpleType\VerticalJc`](/docs/usage/simpletypes/verticaljc.md) for possible values. + * See [`SimpleType > VerticalJc`](/docs/usage/simpletypes/verticaljc.md) for possible values. +- Extends Border + * See [`Style > Border`](/docs/usage/styles/border.md) for additional options. From 4fda29586718d00724453e077d168fe2ee77f184 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 23:09:38 -0500 Subject: [PATCH 041/110] Create section.md --- docs/usage/elements/section.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 docs/usage/elements/section.md diff --git a/docs/usage/elements/section.md b/docs/usage/elements/section.md new file mode 100644 index 0000000000..35e81fbfbb --- /dev/null +++ b/docs/usage/elements/section.md @@ -0,0 +1,14 @@ +#Section + +Sections can be added using the `addSection` method. Sections are the basic containers for all the elements of a document. + +``` php +addSection([$sectionStyle]); +``` + +- `$sectionStyle`. See [`Styles > Section`](../styles/section.md). + +For available styling options, see [`Styles > Section`](../styles/section.md). From 96a0757d2da34e13b7d0ff6f0f42d5fddeb143d8 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 23:12:04 -0500 Subject: [PATCH 042/110] Update paragraph.md --- docs/usage/styles/paragraph.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index e94764b447..7a0b0571f9 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -1,19 +1,17 @@ -# Paragraph -- Extends Border - * See [`\PhpOffice\PhpWord\Style\Border`](/docs/usage/styles/border.md) for additional options. +# Paragraph Style ## Constants - `LINE_HEIGHT` = `240` ## Options - `alignment`. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012. - * See [`\PhpOffice\PhpWord\SimpleType\Jc`](/docs/usage/simpletypes/jc.md) for possible values. + * See [`SimpleType > Jc`](../simpletypes/jc.md) for possible values. - `basedOn`. Parent style. - `bidi`. Right to Left Paragraph Layout, *true* or *false*. - `contextualSpacing`. Ignore Spacing Above and Below When Using Identical Styles, *true* or *false*. - `hanging`. Hanging indentation in *half inches*. - `indentation`. An array of indentation key => value pairs in *twip*. Supports *left*, *right*, *firstLine*, *firstLineChars* and *hanging* indentation. - * See [`\PhpOffice\PhpWord\Style\Indentation`](/docs/usage/styles/indentation.md) for possible identation types. + * See [`Style > Indentation`](../styles/indentation.md) for possible identation types. - `indentHanging`. Hanging indentation in *half inches*. - `indentFirstLine`. First line indentation in *half inches*. - `indentFirstLineChars`. First line character indentation in *half inches*. @@ -25,17 +23,20 @@ - `next`. Style for next paragraph. - `numLevel`. Numbering level. `0` is default. - `numStyle`. Numbering style name - * See [`\PhpOffice\PhpWord\Style\Numbering`](/docs/usage/styles/numbering.md). + * See [`Style > Numbering`](../styles/numbering.md). - `pageBreakBefore`. Start paragraph on next page, *true* or *false*. - `shading`. Paragraph Shading. - `spaceAfter`. Space after paragraph in *twip*. - `spaceBefore`. Space before paragraph in *twip*. - `spacing`. Space between lines in *twip*. If spacingLineRule is auto, 240 (height of 1 line) will be added, so if you want a double line height, set this to 240. - `spacingLineRule`. Line Spacing Rule. *auto*, *exact*, *atLeast* - * See [`\PhpOffice\PhpWord\SimpleType\LineSpacingRule`](/docs/usage/simpletypes/linespacingrule.md) class constants for possible values. + * See [`SimpleType > LineSpacingRule`](../simpletypes/linespacingrule.md) class constants for possible values. - `suppressAutoHyphens`. Hyphenation for paragraph, *true* or *false*. - `tabs`. Set of custom tab stops. - * See [`\PhpOffice\PhpWord\Style\Tab`](/docs/usage/styles/tabs.md). + * See [`Style > Tab`](../styles/tabs.md). - `widowControl`. Allow first/last line to display on a separate page, *true* or *false*. - `textAlignment`. Vertical Character Alignment on Line. - * See [`\PhpOffice\PhpWord\SimpleType\TextAlignment`](/docs/usage/simpletypes/textalignment.md) class constants for possible values. + * See [`SimpleType > TextAlignment`](/docs/usage/simpletypes/textalignment.md) class constants for possible values. + +Extends Border +- See [`Style > Border`](../styles/border.md) for additional options. From c47b6088b7b36ecbddcfa8ecdb5e523ed2e95b55 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 23:13:04 -0500 Subject: [PATCH 043/110] Update section.md --- docs/usage/styles/section.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/usage/styles/section.md b/docs/usage/styles/section.md index 658bb8ca31..768c87ed81 100644 --- a/docs/usage/styles/section.md +++ b/docs/usage/styles/section.md @@ -13,15 +13,16 @@ - `gutter`. Page gutter spacing. `0` is default. - `headerHeight`. Spacing to top of header. `720` is default. - `lineNumbering`. Line numbering. - * See [`Style > LineNumbering`](/docs/usage/styles/linenumbering.md) for possible values. + * See [`Style > LineNumbering`](../styles/linenumbering.md) for possible values. - `orientation`. Page orientation. `ORIENTATION_PORTRAIT` is default. * See constants above for possible values. - `pageNumberingStart`. Starting page number. - `pageSizeH`. Page height in *twip*. `16837.79527559` is default. - `pageSizeW`. Page width in *twip*. `11905.511811024` is default. - `paperSize`. Paper size. `A4` is default. - * See [`Style > Paper`](/docs/usage/styles/paper.md) for possible values + * See [`Style > Paper`](../styles/paper.md) for possible values - `vAlign`. Vertical page alignment. - * See [`SimpleType > VerticalJc`](/docs/usage/simpletypes/verticaljc.md) for possible values. -- Extends Border - * See [`Style > Border`](/docs/usage/styles/border.md) for additional options. + * See [`SimpleType > VerticalJc`](../simpletypes/verticaljc.md) for possible values. + +Extends Border +- See [`Style > Border`](../styles/border.md) for additional options. From 41034fa9b87e436c8d492f7fe3a1fd9e19a722c4 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 23:13:38 -0500 Subject: [PATCH 044/110] Update font.md --- docs/usage/styles/font.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/usage/styles/font.md b/docs/usage/styles/font.md index c97aadab80..c20f14611d 100644 --- a/docs/usage/styles/font.md +++ b/docs/usage/styles/font.md @@ -1,4 +1,4 @@ -# Font +# Font Styles ## Constants - Underline @@ -29,10 +29,10 @@ - `italic`. Italic, *true* or *false*. - `kerning`. Font kerning: halfpoint. - `lang`. Language, either a language code like *en-US*, *fr-BE*, etc. or an object (or as an array) if you need to set eastAsian or bidirectional languages - * See [`\PhpOffice\PhpWord\Style\Language`](/docs/usage/styles/language.md) class for some language codes. + * See [`Style >Language`](../styles/language.md) class for some language codes. - `lineHeight`. Line height. - `paragraph`. Paragraph. - * See [`\PhpOffice\PhpWord\Style\Paragraph`](/docs/usage/styles/paragraph.md). + * See [`Style >Paragraph`](../styles/paragraph.md). - `name`. Font name, e.g. *Arial*. - `noProof`. Disable AutoCorrect, *true* or *false*. - `position`. The text position, raised or lowered, in half points From 615ffeca2085bad64c2f0d6a6129ef83dee13d38 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 23:14:17 -0500 Subject: [PATCH 045/110] Update border.md --- docs/usage/styles/border.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/usage/styles/border.md b/docs/usage/styles/border.md index b7e7dabfff..d8317563f7 100644 --- a/docs/usage/styles/border.md +++ b/docs/usage/styles/border.md @@ -1,8 +1,8 @@ -# Border +# Border Styles ## Options - `border(Top|Right|Bottom|Left)Size`. Border size in *twip*. - `border(Top|Right|Bottom|Left)Color`. Border color, eg '9966CC'. - `border(Top|Right|Bottom|Left)Style`. Border style. - * See [`\PhpOffice\PhpWord\SimpleType\Border`](/docs/usage/simpletypes/border.md) class constants for possible values. + * See [`SimpleType > Border`](../simpletypes/border.md) class constants for possible values. - `margin(Top|Right|Bottom|Left)`. Page margin in *twip*. `1440` is default. From f50fc6f67b0af39ac31192b666b5be446bcccc16 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 20 Sep 2025 23:14:39 -0500 Subject: [PATCH 046/110] Update paragraph.md --- docs/usage/styles/paragraph.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index 7a0b0571f9..bafea116ca 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -1,4 +1,4 @@ -# Paragraph Style +# Paragraph Styles ## Constants - `LINE_HEIGHT` = `240` From 666a1cd8caf129bc98704a46e1ed3ffd0aaf3442 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 12:43:14 -0500 Subject: [PATCH 047/110] Update section.md --- docs/usage/styles/section.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/usage/styles/section.md b/docs/usage/styles/section.md index 768c87ed81..f1ddc22b52 100644 --- a/docs/usage/styles/section.md +++ b/docs/usage/styles/section.md @@ -1,5 +1,15 @@ # Section Styles +``` php + 'Letter', 'vAlign' => VerticalType::CENTER]; +$section = $phpWord->addSection([$sectionStyle]); +``` + +See [`Sample_03_Sections`](/samples/Sample_03_Sections.php) for more code samples. + ## Constants - Orientation * `ORIENTATION_PORTRAIT` @@ -24,5 +34,8 @@ - `vAlign`. Vertical page alignment. * See [`SimpleType > VerticalJc`](../simpletypes/verticaljc.md) for possible values. -Extends Border +### Extends Border - See [`Style > Border`](../styles/border.md) for additional options. + +## Used In +- [`Element > Section`](../elements/section.md). From b966d0582eb14e05f5108daecc80edd805cefd85 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 12:57:59 -0500 Subject: [PATCH 048/110] Update border.md --- docs/usage/styles/border.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/usage/styles/border.md b/docs/usage/styles/border.md index d8317563f7..98f4b9d011 100644 --- a/docs/usage/styles/border.md +++ b/docs/usage/styles/border.md @@ -1,8 +1,25 @@ # Border Styles +``` php + 10, 'borderColor' => '#FF0000', 'margin' => 50]; +$phpWord->addTableStyle($tableStyleName, $tableStyle) +$table = $section->addTable($tableStyleName); +``` + +See [`Sample_03_Sections`](/samples/Sample_03_Sections.php) and [`Sample_09_Tables`](/samples/Sample_09_Tables.php) for more code samples. + ## Options - `border(Top|Right|Bottom|Left)Size`. Border size in *twip*. - `border(Top|Right|Bottom|Left)Color`. Border color, eg '9966CC'. - `border(Top|Right|Bottom|Left)Style`. Border style. * See [`SimpleType > Border`](../simpletypes/border.md) class constants for possible values. - `margin(Top|Right|Bottom|Left)`. Page margin in *twip*. `1440` is default. + +## Used In +- [`Style > Cell`](../styles/cell.md). +- [`Style > Paragraph`](../styles/paragraph.md). +- [`Style > Section`](../styles/section.md). +- [`Style > Table`](../styles/table.md). From 62f80190a326980d52e086ab5dabe9e807e57764 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 12:58:08 -0500 Subject: [PATCH 049/110] Update section.md --- docs/usage/styles/section.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/styles/section.md b/docs/usage/styles/section.md index f1ddc22b52..9041710b6a 100644 --- a/docs/usage/styles/section.md +++ b/docs/usage/styles/section.md @@ -5,7 +5,7 @@ use PhpOffice\PhpWord\SimpleTypes\VerticalJC as VerticalType; $sectionStyle = ['paperSize' => 'Letter', 'vAlign' => VerticalType::CENTER]; -$section = $phpWord->addSection([$sectionStyle]); +$section = $phpWord->addSection($sectionStyle); ``` See [`Sample_03_Sections`](/samples/Sample_03_Sections.php) for more code samples. From 2dac833cb4a90bd9ad058662a61a8b8d4e1d279b Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 13:12:05 -0500 Subject: [PATCH 050/110] Update font.md --- docs/usage/styles/font.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/usage/styles/font.md b/docs/usage/styles/font.md index c20f14611d..07cda40834 100644 --- a/docs/usage/styles/font.md +++ b/docs/usage/styles/font.md @@ -1,9 +1,26 @@ # Font Styles +``` php +addFontStyle('title', ['color' => '#FF0000', 'size' => 32]); + +``` + +``` php + 'Arial', 'bold' => true, 'underline' => FontStyle::UNDERLINE_DASH]; +$section->addText('Hello, world!', $fontStyle); + +``` + ## Constants - Underline * `UNDERLINE_NONE` - * `UNDERLINE_DASH`, `UNDERLINE_DASHHEAVY`, `UNDERLINE_DASHLONG`, `UNDERLINE_DASHLONGHEAVY` + * `UNDERLINE_DASH`, `UNDERLINE_DASHHEAVY`, + * `UNDERLINE_DASHLONG`, `UNDERLINE_DASHLONGHEAVY` * `UNDERLINE_SINGLE`, `UNDERLINE_DOUBLE`, `UNDERLINE_HEAVY` * `UNDERLINE_DOTDASH`, `UNDERLINE_DOTDASHHEAVY` * `UNDERLINE_DOTDOTDASH`, `UNDERLINE_DOTDOTDASHHEAVY` @@ -48,3 +65,15 @@ - `underline`. Underline, *single*, *dash*, *dotted*, etc. `UNDERLINE_NONE` is default. * See constants above for possible values. - `whiteSpace`. How white space is handled when generating html/pdf. Possible values are *pre-wrap* and *normal* (other css values for white space are accepted, but are not expected to be useful). + +## Used In +- [`Element > CheckBox`](../elements/checkbox.md). +- [`Element > Field`](../elements/field.md). +- [`Element > FormField`](../elements/formfield.md). +- [`Element > Link`](../elements/link.md). +- [`Element > ListItem`](../elements/listitem.md). +- [`Element > PreserveText`](../elements/preservetext.md). +- [`Element > SDT`](../elements/sdt.md). +- [`Element > Text`](../elements/text.md). +- [`Element > TextBreak`](../elements/textbreak.md). +- [`Element > TOC`](../elements/toc.md). From 1d10fce694f616c49677461ed29b4896a770b076 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 13:25:09 -0500 Subject: [PATCH 051/110] Update paragraph.md --- docs/usage/styles/paragraph.md | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index bafea116ca..14d914c37b 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -1,9 +1,26 @@ # Paragraph Styles +``` php +addParagraphStyle('header', ['align' => 'center', 'spaceAfter' => 240]); + +``` + +``` php + JcType::BOTH, 'keepNext' => true]; +$section->addText('Hello, world!', null, $paragraphStyle); + +``` + ## Constants - `LINE_HEIGHT` = `240` ## Options +- `align`. Same as alignment. - `alignment`. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012. * See [`SimpleType > Jc`](../simpletypes/jc.md) for possible values. - `basedOn`. Parent style. @@ -38,5 +55,19 @@ - `textAlignment`. Vertical Character Alignment on Line. * See [`SimpleType > TextAlignment`](/docs/usage/simpletypes/textalignment.md) class constants for possible values. -Extends Border +### Extends Border - See [`Style > Border`](../styles/border.md) for additional options. + +## Used In +- [`Element > CheckBox`](../elements/checkbox.md). +- [`Element > Endnote`](../elements/endnote.md). +- [`Element > Footnote`](../elements/footnote.md). +- [`Element > FormField`](../elements/formfield.md). +- [`Element > Link`](../elements/link.md). +- [`Element > ListItem`](../elements/list.md). +- [`Element > ListItemRun`](../elements/listitemrun.md). +- [`Element > PreserveText`](../elements/preservetext.md). +- [`Element > SDT`](../elements/sdt.md). +- [`Element > Text`](../elements/text.md). +- [`Element > TextBreak`](../elements/textbreak.md). +- [`Element > TextRun`](../elements/textrun.md). From 99eb31909921cda559917a8e28d2d7962266bbb8 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 13:25:18 -0500 Subject: [PATCH 052/110] Update font.md --- docs/usage/styles/font.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/styles/font.md b/docs/usage/styles/font.md index 07cda40834..be02e3c8df 100644 --- a/docs/usage/styles/font.md +++ b/docs/usage/styles/font.md @@ -71,7 +71,7 @@ $section->addText('Hello, world!', $fontStyle); - [`Element > Field`](../elements/field.md). - [`Element > FormField`](../elements/formfield.md). - [`Element > Link`](../elements/link.md). -- [`Element > ListItem`](../elements/listitem.md). +- [`Element > ListItem`](../elements/list.md). - [`Element > PreserveText`](../elements/preservetext.md). - [`Element > SDT`](../elements/sdt.md). - [`Element > Text`](../elements/text.md). From 507226efb83dad439c8740753fa8455740b67272 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 13:28:35 -0500 Subject: [PATCH 053/110] Update paper.md --- docs/usage/styles/paper.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/usage/styles/paper.md b/docs/usage/styles/paper.md index 9ccae0c5bd..f67072ab34 100644 --- a/docs/usage/styles/paper.md +++ b/docs/usage/styles/paper.md @@ -8,3 +8,6 @@ ## Options - `size`. Page size. `A4` is default. * See sizes above for possible values. + +## Used In +- [`Style > Section`](../styles/section.md). From 00cbd6c0fdb3861838091bb2c5f9f3de944a0ce4 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 13:30:11 -0500 Subject: [PATCH 054/110] Update language.md --- docs/usage/styles/language.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/usage/styles/language.md b/docs/usage/styles/language.md index 6c4aca4e83..948f61daa3 100644 --- a/docs/usage/styles/language.md +++ b/docs/usage/styles/language.md @@ -11,3 +11,6 @@ - `latin`. - `eastAsia`. - `bidirectional`. + +## Used In +- [`Style > Font`](../styles/font.md). From 9f9a564c76ab7a70022aa44e99da2d323538df8c Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 13:31:29 -0500 Subject: [PATCH 055/110] Update font.md --- docs/usage/styles/font.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/usage/styles/font.md b/docs/usage/styles/font.md index be02e3c8df..0264c5d2a7 100644 --- a/docs/usage/styles/font.md +++ b/docs/usage/styles/font.md @@ -16,6 +16,8 @@ $section->addText('Hello, world!', $fontStyle); ``` +See [`Sample_013_SimpleText`](/samples/Sample_01_SimpleText.php) for more code samples. + ## Constants - Underline * `UNDERLINE_NONE` From f9c214c90a1064ef717c0116225ce4928bbf8dac Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 13:31:52 -0500 Subject: [PATCH 056/110] Update paragraph.md --- docs/usage/styles/paragraph.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index 14d914c37b..44d031c40f 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -16,6 +16,8 @@ $section->addText('Hello, world!', null, $paragraphStyle); ``` +See [`Sample_01_SimpleText`](/samples/Sample_01_SimpleText.php) for more code samples. + ## Constants - `LINE_HEIGHT` = `240` From 743df194051593336fd1ef8cc92070784c06e32d Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 13:32:01 -0500 Subject: [PATCH 057/110] Update font.md --- docs/usage/styles/font.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/styles/font.md b/docs/usage/styles/font.md index 0264c5d2a7..5e28a17179 100644 --- a/docs/usage/styles/font.md +++ b/docs/usage/styles/font.md @@ -16,7 +16,7 @@ $section->addText('Hello, world!', $fontStyle); ``` -See [`Sample_013_SimpleText`](/samples/Sample_01_SimpleText.php) for more code samples. +See [`Sample_01_SimpleText`](/samples/Sample_01_SimpleText.php) for more code samples. ## Constants - Underline From 10627ee65fa272698817e77b2fe549473ce28a9a Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 13:47:33 -0500 Subject: [PATCH 058/110] Update border.md --- docs/usage/simpletypes/border.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/usage/simpletypes/border.md b/docs/usage/simpletypes/border.md index e0c6092c55..17917bb202 100644 --- a/docs/usage/simpletypes/border.md +++ b/docs/usage/simpletypes/border.md @@ -28,3 +28,6 @@ - `THREE_D_ENGRAVE`. A three-staged gradient like, getting darker away from the paragraph - `TRIPLE`. A triple line - `WAVE`. A wavy line + +## Used In +- [`Style > Border`](../styles/border.md). From 095f46d97a190ffbca840e7a5755bbaf4d716472 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 13:52:38 -0500 Subject: [PATCH 059/110] Update jc.md --- docs/usage/simpletypes/jc.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/usage/simpletypes/jc.md b/docs/usage/simpletypes/jc.md index a16574107a..e3cfc43923 100644 --- a/docs/usage/simpletypes/jc.md +++ b/docs/usage/simpletypes/jc.md @@ -5,14 +5,20 @@ - `CENTER`. - `END`. Commonly known as *right*. - `BOTH`. Commonly known as *justify*. -- `MEDIUM_KASHIDA`. -- `DISTRIBUTE`. - `NUM_TAB`. +- `DISTRIBUTE`. +- `THAI_DISTRIBUTE`. - `HIGH_KASHIDA`. +- `MEDIUM_KASHIDA`. - `LOW_KASHIDA`. -- `THAI_DISTRIBUTE`. Deprecated - `LEFT`. - `RIGHT`. - `JUSTIFY`. + +## Used In +- [`Style > Frame`](../styles/frame.md). +- [`Style > NumberingLevel`](../styles/numberinglevel.md). +- [`Style > Paragraph`](../styles/paragraph.md). +- [`Style > Table`](../styles/table.md). From 5e967ca1ebca9925d6f318e32fd1e684c976873f Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 13:56:07 -0500 Subject: [PATCH 060/110] Update linespacingrule.md --- docs/usage/simpletypes/linespacingrule.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/usage/simpletypes/linespacingrule.md b/docs/usage/simpletypes/linespacingrule.md index 79e891386b..201e79dc9a 100644 --- a/docs/usage/simpletypes/linespacingrule.md +++ b/docs/usage/simpletypes/linespacingrule.md @@ -4,3 +4,7 @@ - `AUTO`. - `EXACT`. - `AT_LEAST`. + +## Used In +- [`Style > Paragraph`](../styles/paragraph.md). +- [`Style > Spacing`](../styles/spacing.md). From 569bf01934fa20e89c15241043784a7647b171be Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 13:58:14 -0500 Subject: [PATCH 061/110] Update verticaljc.md --- docs/usage/simpletypes/verticaljc.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/usage/simpletypes/verticaljc.md b/docs/usage/simpletypes/verticaljc.md index c2ee6859f7..cac2db631a 100644 --- a/docs/usage/simpletypes/verticaljc.md +++ b/docs/usage/simpletypes/verticaljc.md @@ -5,3 +5,7 @@ - `CENTER`. - `BOTH`. - `BOTTOM`. + +## Used In +- [`Style > Cell`](../styles/cell.md). +- [`Style > Section`](../styles/section.md). From 5313581d781cb97691ba6916154fe9019b91aa28 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 14:04:07 -0500 Subject: [PATCH 062/110] Update numberformat.md --- docs/usage/simpletypes/numberformat.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/usage/simpletypes/numberformat.md b/docs/usage/simpletypes/numberformat.md index 27e5b7278d..227bd9a486 100644 --- a/docs/usage/simpletypes/numberformat.md +++ b/docs/usage/simpletypes/numberformat.md @@ -3,7 +3,6 @@ ## Constants - `NONE`. No Numbering. - `BULLET`. Bullet. -- `DECIMAL`. Decimal Numbers. - `UPPER_ROMAN`. Uppercase Roman Numerals. - `LOWER_ROMAN`. Lowercase Roman Numerals. - `UPPER_LETTER`. Uppercase Latin Alphabet. @@ -13,7 +12,9 @@ - `CARDINAL_TEXT`. Cardinal Text. - `HEX`. Hexadecimal Numbering. - `CHICAGO`. Chicago Manual of Style. -- `NUMBER_IN_DASH`. Number With Dashes. + +### Decimal +- `DECIMAL`. Decimal Numbers. - `DECIMAL_ZERO`. Initial Zero Arabic Numerals. - `DECIMAL_FULL_WIDTH`. Double Byte Arabic Numerals. - `DECIMAL_FULL_WIDTH2`. Double Byte Arabic Numerals Alternate. @@ -22,12 +23,17 @@ - `DECIMAL_ENCLOSED_FULL_STOP`. Decimal Numbers Followed by a Period. - `DECIMAL_ENCLOSED_PAREN`. Decimal Numbers Enclosed in Parenthesis. - `DECIMAL_ENCLOSED_CIRCLE_CHINESE`. Decimal Numbers Enclosed in a Circle. +- `NUMBER_IN_DASH`. Number With Dashes. + +### Ideograph - `IDEOGRAPH_DIGITAL`. Ideographs. - `IDEOGRAPHENCLOSEDCIRCLE`. Ideographs Enclosed in a Circle. - `IDEOGRAPH_TRADITIONAL`. Traditional Ideograph Format. - `IDEOGRAPH_ZODIAC`. Zodiac Ideograph Format. - `IDEOGRAPH_ZODIAC_TRADITIONAL`. Traditional Zodiac Ideograph Format. - `IDEOGRAPH_LEGAL_TRADITIONAL`. Traditional Legal Ideograph Format. + +### Non-Roman Systems - `AIUEO`. AIUEO Order Hiragana. - `AIUEO_FULL_WIDTH`. Full-Width AIUEO Order Hiragana. - `IROHA`. Iroha Ordered Katakana. @@ -61,3 +67,6 @@ - `TAIWANESE_COUNTING`. Taiwanese Counting System. - `TAIWANESE_COUNTING_THOUSAND`. Taiwanese Counting Thousand System. - `TAIWANESE_DIGITAL`. Taiwanese Digital Counting System. + +## Used In +- [`Style > NumberingLevel`](../styles/numberinglevel.md). From 4618b67622e0744e0009e3182acc35d56c976cba Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 14:09:59 -0500 Subject: [PATCH 063/110] Update section.md --- docs/usage/elements/section.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/usage/elements/section.md b/docs/usage/elements/section.md index 35e81fbfbb..67461497aa 100644 --- a/docs/usage/elements/section.md +++ b/docs/usage/elements/section.md @@ -1,14 +1,15 @@ -#Section +# Section -Sections can be added using the `addSection` method. Sections are the basic containers for all the elements of a document. +Sections are the basic containers for most elements within a document. Sections can be added using the `addSection` method. ``` php addSection([$sectionStyle]); +$section->addText('Hello, World!'); ``` -- `$sectionStyle`. See [`Styles > Section`](../styles/section.md). - For available styling options, see [`Styles > Section`](../styles/section.md). + +See [`Sample_03_Sections`](/samples/Sample_03_Sections.php) for more code samples. From e66709de144c6721bfdee0109cd9ced7b4c6ae36 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 14:11:35 -0500 Subject: [PATCH 064/110] Update border.md --- docs/usage/styles/border.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/styles/border.md b/docs/usage/styles/border.md index 98f4b9d011..cf01410483 100644 --- a/docs/usage/styles/border.md +++ b/docs/usage/styles/border.md @@ -19,7 +19,7 @@ See [`Sample_03_Sections`](/samples/Sample_03_Sections.php) and [`Sample_09_Tabl - `margin(Top|Right|Bottom|Left)`. Page margin in *twip*. `1440` is default. ## Used In -- [`Style > Cell`](../styles/cell.md). +- [`Style > Cell`](../styles/table.md). - [`Style > Paragraph`](../styles/paragraph.md). - [`Style > Section`](../styles/section.md). - [`Style > Table`](../styles/table.md). From 9a28e0776731e1e232648d3870258fa05b609ac9 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 14:13:09 -0500 Subject: [PATCH 065/110] Update paragraph.md --- docs/usage/styles/paragraph.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index 44d031c40f..54048e979a 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -67,9 +67,9 @@ See [`Sample_01_SimpleText`](/samples/Sample_01_SimpleText.php) for more code sa - [`Element > FormField`](../elements/formfield.md). - [`Element > Link`](../elements/link.md). - [`Element > ListItem`](../elements/list.md). -- [`Element > ListItemRun`](../elements/listitemrun.md). +- [`Element > ListItemRun`](../elements/list.md). - [`Element > PreserveText`](../elements/preservetext.md). - [`Element > SDT`](../elements/sdt.md). - [`Element > Text`](../elements/text.md). - [`Element > TextBreak`](../elements/textbreak.md). -- [`Element > TextRun`](../elements/textrun.md). +- [`Element > TextRun`](../elements/text.md). From 0330859d7d98f9e690fdf3b2f4a7a344f17d298e Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 14:15:28 -0500 Subject: [PATCH 066/110] Update paragraph.md --- docs/usage/styles/paragraph.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index 54048e979a..2094fa8482 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -4,6 +4,7 @@ addParagraphStyle('header', ['align' => 'center', 'spaceAfter' => 240]); +$section->addText('Hello, World!', null, 'header'); ``` @@ -12,7 +13,7 @@ $phpWord->addParagraphStyle('header', ['align' => 'center', 'spaceAfter' => 240] use PhpOffice\PhpWord\SimpleType\Jc as JcType; $paragraphStyle = ['align' => JcType::BOTH, 'keepNext' => true]; -$section->addText('Hello, world!', null, $paragraphStyle); +$section->addText('Hello, World!', null, $paragraphStyle); ``` From f34e2771aa7c8e776f4b5e1cc8a9b7c293c1c9fb Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 14:15:55 -0500 Subject: [PATCH 067/110] Update font.md --- docs/usage/styles/font.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/usage/styles/font.md b/docs/usage/styles/font.md index 5e28a17179..2843d592ac 100644 --- a/docs/usage/styles/font.md +++ b/docs/usage/styles/font.md @@ -4,6 +4,7 @@ addFontStyle('title', ['color' => '#FF0000', 'size' => 32]); +$section->addText('Hello, World!', 'title'); ``` @@ -12,7 +13,7 @@ $phpWord->addFontStyle('title', ['color' => '#FF0000', 'size' => 32]); use PhpOffice\PhpWord\Style\Font as FontStyle; $fontStyle = ['name' => 'Arial', 'bold' => true, 'underline' => FontStyle::UNDERLINE_DASH]; -$section->addText('Hello, world!', $fontStyle); +$section->addText('Hello, World!', $fontStyle); ``` From 24a913935de8f8df604a95b998d164e4d68ccb97 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 14:18:49 -0500 Subject: [PATCH 068/110] Update linenumbering.md --- docs/usage/styles/linenumbering.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/usage/styles/linenumbering.md b/docs/usage/styles/linenumbering.md index c68a81b217..5fb7be254a 100644 --- a/docs/usage/styles/linenumbering.md +++ b/docs/usage/styles/linenumbering.md @@ -11,3 +11,6 @@ - `distance`. Distance between text and line numbering in *twip*. - `restart`. Line numbering restart setting. * See constants above for possible values. + +## Used In +- [`Style > Section`](../styles/section.md). From e994ca38c5e98902390d15f8cee13c88b499862f Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 14:19:48 -0500 Subject: [PATCH 069/110] Update paper.md --- docs/usage/styles/paper.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/usage/styles/paper.md b/docs/usage/styles/paper.md index f67072ab34..cfb17e8b7d 100644 --- a/docs/usage/styles/paper.md +++ b/docs/usage/styles/paper.md @@ -1,13 +1,9 @@ # Paper -## Constants -- Sizes +## Options +- `size`. Page size. `A4` is default. Possible values include: * `A3`, `A4`, `A5`, `B5` * `Letter`, `Legal`, `Folio` -## Options -- `size`. Page size. `A4` is default. - * See sizes above for possible values. - ## Used In - [`Style > Section`](../styles/section.md). From 911da1c4a7cd66716d481d29dc51c27e7b112448 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 21:11:59 -0500 Subject: [PATCH 070/110] Update paragraph.md --- docs/usage/styles/paragraph.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index 2094fa8482..58f4201ddb 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -17,7 +17,7 @@ $section->addText('Hello, World!', null, $paragraphStyle); ``` -See [`Sample_01_SimpleText`](/samples/Sample_01_SimpleText.php) for more code samples. +See [`Sample_01_SimpleText`](/samples/Sample_01_SimpleText.php) and [`Sample_08_ParagraphPagination`](/samples/Sample_08_ParagraphPagination.php) for more code samples. ## Constants - `LINE_HEIGHT` = `240` From 984174dff07371a2e45f6ff56ed83ffd360faef7 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 21:18:06 -0500 Subject: [PATCH 071/110] Create indentation.md --- docs/usage/styles/indentation.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 docs/usage/styles/indentation.md diff --git a/docs/usage/styles/indentation.md b/docs/usage/styles/indentation.md new file mode 100644 index 0000000000..0473f849d5 --- /dev/null +++ b/docs/usage/styles/indentation.md @@ -0,0 +1,21 @@ +# Indentation Styles + +``` php +addParagraphStyle('line', ['indentation' => ['left' => 240, 'right' => 120]]); +$section->addText('Hello, World!', null, 'line'); + +``` + +See [`Sample_08_ParagraphPagination`](/samples/Sample_08_ParagraphPagination.php) for more code samples. + +## Options +- `left`. Left indentation in *twip*. +- `right`. Right indentation in *twip*. +- `firstLine`. Additional first line indentation in *twip*. +- `firstLineChars`. Additional first line chars indentation in *twip*. +- `hanging`. Indentation removed from first line *twip*. + +## Used In +- [`Style > Paragraph`](../styles/paragraph.md). From 39e9225c386b15822078141f96b0731296ddfe98 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 21:30:03 -0500 Subject: [PATCH 072/110] Update font.md --- docs/usage/styles/font.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/usage/styles/font.md b/docs/usage/styles/font.md index 2843d592ac..03d4c66210 100644 --- a/docs/usage/styles/font.md +++ b/docs/usage/styles/font.md @@ -49,10 +49,10 @@ See [`Sample_01_SimpleText`](/samples/Sample_01_SimpleText.php) for more code sa - `italic`. Italic, *true* or *false*. - `kerning`. Font kerning: halfpoint. - `lang`. Language, either a language code like *en-US*, *fr-BE*, etc. or an object (or as an array) if you need to set eastAsian or bidirectional languages - * See [`Style >Language`](../styles/language.md) class for some language codes. + * See [`Style > Language`](../styles/language.md) class for some language codes. - `lineHeight`. Line height. - `paragraph`. Paragraph. - * See [`Style >Paragraph`](../styles/paragraph.md). + * See [`Style > Paragraph`](../styles/paragraph.md). - `name`. Font name, e.g. *Arial*. - `noProof`. Disable AutoCorrect, *true* or *false*. - `position`. The text position, raised or lowered, in half points From f4b87170c0d276b2179b94ad33ca1302cfed0b6f Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 21:40:16 -0500 Subject: [PATCH 073/110] Update and rename numberinglevel.md to numbering.md --- docs/usage/styles/numbering.md | 46 +++++++++++++++++++++++++++++ docs/usage/styles/numberinglevel.md | 16 ---------- 2 files changed, 46 insertions(+), 16 deletions(-) create mode 100644 docs/usage/styles/numbering.md delete mode 100644 docs/usage/styles/numberinglevel.md diff --git a/docs/usage/styles/numbering.md b/docs/usage/styles/numbering.md new file mode 100644 index 0000000000..c2e45d3b92 --- /dev/null +++ b/docs/usage/styles/numbering.md @@ -0,0 +1,46 @@ +# Numbering Styles + +``` php +addNumberingStyle( + $multilevelNumberingStyleName, + [ + 'type' => 'multilevel', + 'levels' => [ + ['format' => 'decimal', 'text' => '%1.', 'left' => 360, 'hanging' => 360, 'tabPos' => 360], + ['format' => 'upperLetter', 'text' => '%2.', 'left' => 720, 'hanging' => 360, 'tabPos' => 720], + ], + ] +); + +``` + +See [`Sample_14_ListItem`](/samples/Sample_14_ListItem.php) for more code samples. + +## Options +- `type`. List type, *singleLevel*, *multilevel*, or *hybridMultilevel*. + * `singleLevel` is a list with only a single level, such as a simple bullet or numbered list. + * `multilevel` is a list that can have multiple levels, but all levels use the same type of formatting (e.g., all bullets or all numbers). + * `hybridMultilevel` is a list that can have multiple levels, with different levels potentially using different formatting (e.g., some levels with bullets and others with numbers or letters). +- `levels`. The style for each level of the list. See below. + +## Level Options +- `align`. Same as alignment. +- `alignment`. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012. + * See [`SimpleType > Jc`](../simpletypes/jc.md) for possible values. +- `font`. Font name, e.g. `Arial`. +- `format`. Numbering format. + * See [`SimpleType > NumberFormat`](../simpletypes/numberformat.md). +- `hanging`. Hanging in `twip`. +- `hint`. Font content type, `default`, `eastAsia`, or `cs`. +- `left`. Left in `twip`. +- `restart`. Restart numbering level symbol. +- `start`. Starting value. `1` is default. +- `suffix`. Content between numbering symbol and paragraph text, `tab`, `space`, or `nothing`. `tab` is default. +- `tabPos`. Tab position in `twip`. +- `text`. Numbering level text e.g. %1 for nonbullet or bullet character. + +## Used In +- [`Styles > ListItem`](../styles/list.md). +- [`Styles > Paragraph`](../styles/paragraph.md). diff --git a/docs/usage/styles/numberinglevel.md b/docs/usage/styles/numberinglevel.md deleted file mode 100644 index 392e820048..0000000000 --- a/docs/usage/styles/numberinglevel.md +++ /dev/null @@ -1,16 +0,0 @@ -# Numbering level - -Available NumberingLevel style options: - -- ``alignment``. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012. - See ``\PhpOffice\PhpWord\SimpleType\Jc`` class constants for possible values. -- ``font``. Font name. -- ``format``. Numbering format bullet\|decimal\|upperRoman\|lowerRoman\|upperLetter\|lowerLetter. -- ``hanging``. See paragraph style. -- ``hint``. See font style. -- ``left``. See paragraph style. -- ``restart``. Restart numbering level symbol. -- ``start``. Starting value. -- ``suffix``. Content between numbering symbol and paragraph text tab\|space\|nothing. -- ``tabPos``. See paragraph style. -- ``text``. Numbering level text e.g. %1 for nonbullet or bullet character. \ No newline at end of file From 56469553d307c0fa3d1d6602557ac13814960af4 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 21:41:41 -0500 Subject: [PATCH 074/110] Update numbering.md --- docs/usage/styles/numbering.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/usage/styles/numbering.md b/docs/usage/styles/numbering.md index c2e45d3b92..e199ad470d 100644 --- a/docs/usage/styles/numbering.md +++ b/docs/usage/styles/numbering.md @@ -4,9 +4,9 @@ addNumberingStyle( - $multilevelNumberingStyleName, + 'numberssAndLetters', [ - 'type' => 'multilevel', + 'type' => 'hybridMultilevel', 'levels' => [ ['format' => 'decimal', 'text' => '%1.', 'left' => 360, 'hanging' => 360, 'tabPos' => 360], ['format' => 'upperLetter', 'text' => '%2.', 'left' => 720, 'hanging' => 360, 'tabPos' => 720], From 9f176c9b51f88ed589734fa84c4c2f36e0002b87 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 21:56:01 -0500 Subject: [PATCH 075/110] Create list.md --- docs/usage/styles/list.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 docs/usage/styles/list.md diff --git a/docs/usage/styles/list.md b/docs/usage/styles/list.md new file mode 100644 index 0000000000..6503f68442 --- /dev/null +++ b/docs/usage/styles/list.md @@ -0,0 +1,29 @@ +# ListItem Styles + +``` php + ListStyle::TYPE_NUMBER_NESTED]; +$section->addListItem('List Item 1', 0, null, $listStyle); +``` + +See [`Sample_14_ListItem`](/samples/Sample_14_ListItem.php) for more code samples. + +## Constants +- `TYPE_SQUARE_FILLED` +- `TYPE_BULLET_FILLED` +- `TYPE_BULLET_EMPTY` +- `TYPE_NUMBER` +- `TYPE_NUMBER_NESTED` +- `TYPE_ALPHANUM` + +## Options +- `listType`. Predefined numbering styles. + * See constants above for possible values. +- `numStyle`. + * See [`Styles > Numbering`](../styles/numbering.md) for possible values. + +## Used In +- [`Element > ListItem`](../elements/list.md). +- [`Element > ListItemRun`](../elements/list.md). From 7621af54a87cdce47c4dbe661b590c5d213f5cf4 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 21:59:39 -0500 Subject: [PATCH 076/110] Update list.md --- docs/usage/styles/list.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/usage/styles/list.md b/docs/usage/styles/list.md index 6503f68442..55466a6f23 100644 --- a/docs/usage/styles/list.md +++ b/docs/usage/styles/list.md @@ -11,12 +11,12 @@ $section->addListItem('List Item 1', 0, null, $listStyle); See [`Sample_14_ListItem`](/samples/Sample_14_ListItem.php) for more code samples. ## Constants -- `TYPE_SQUARE_FILLED` -- `TYPE_BULLET_FILLED` -- `TYPE_BULLET_EMPTY` -- `TYPE_NUMBER` -- `TYPE_NUMBER_NESTED` -- `TYPE_ALPHANUM` +- `TYPE_SQUARE_FILLED`. +- `TYPE_BULLET_FILLED`. +- `TYPE_BULLET_EMPTY`. +- `TYPE_NUMBER`. +- `TYPE_NUMBER_NESTED`. L1: 1., L2: 1.1., L3: 1.1.1. etc. +- `TYPE_ALPHANUM`. L1: Decimal, L2: LowerLetter, L3: LowerRoman repeat. ## Options - `listType`. Predefined numbering styles. From fcb02bd3254c8433054d75278a256a612089f804 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 22:03:34 -0500 Subject: [PATCH 077/110] Create textalignment.md --- docs/usage/simpletypes/textalignment.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 docs/usage/simpletypes/textalignment.md diff --git a/docs/usage/simpletypes/textalignment.md b/docs/usage/simpletypes/textalignment.md new file mode 100644 index 0000000000..7b321ff9a0 --- /dev/null +++ b/docs/usage/simpletypes/textalignment.md @@ -0,0 +1,11 @@ +# Text Alignment + +## Constants +- `TOP`. Align Text at Top. +- `CENTER`. Align Text at Center. +- `BASELINE`. Align Text at Baseline. +- `BOTTOM`. Align Text at Bottom. +- `AUTO`. Automatically Determine Alignment. + +## Used In +- [`Style > Paragraph`](../styles/paragraph.md). From d662167492e777419458218891ab13bc10fd5187 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 22:18:48 -0500 Subject: [PATCH 078/110] Create tab.md --- docs/usage/simpletypes/tab.md | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 docs/usage/simpletypes/tab.md diff --git a/docs/usage/simpletypes/tab.md b/docs/usage/simpletypes/tab.md new file mode 100644 index 0000000000..104201c034 --- /dev/null +++ b/docs/usage/simpletypes/tab.md @@ -0,0 +1,48 @@ +# Tab Style + +``` php +addParagraphStyle( + 'tabStyle', + [ + 'tabs' => [ + new TabStyle(TabStyle::TAB_STOP_LEFT, 1440, TabStyle::TAB_LEADER_DOT), + new TabStyle(TabStyle::TAB_STOP_CENTER, 5000), + new TabStyle(TabStyle::TAB_STOP_RIGHT, 9340), + ], + ] +); + +``` + +See [`Sample_02_TabStops`](/samples/Sample_02_TabStops.php) for more code samples. + +## Constants +- Tab Stop + * `TAB_STOP_CLEAR` + * `TAB_STOP_LEFT` + * `TAB_STOP_CENTER` + * `TAB_STOP_RIGHT` + * `TAB_STOP_DECIMAL` + * `TAB_STOP_BAR` + * `TAB_STOP_NUM` + +- Tab Leader + * `TAB_LEADER_NONE` + * `TAB_LEADER_DOT` + * `TAB_LEADER_HYPHEN` + * `TAB_LEADER_UNDERSCORE` + * `TAB_LEADER_HEAVY` + * `TAB_LEADER_MIDDLEDOT` + +## Options +- `type`. Stop type. `TAB_STOP_CLEAR` is default. + * See constants above for possible values. +- `leader`. Tab leader character. `TAB_LEADER_NONE` is default. + * See constants above for possible values. +- `position`. Tab stop position in *twip*. + +## Used In +- [`Style > Paragraph`](../styles/paragraph.md). From 25bc5581271279882d8169766cf08a05cdad3fe3 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 22:19:10 -0500 Subject: [PATCH 079/110] Rename tab.md to tab.md --- docs/usage/{simpletypes => styles}/tab.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/usage/{simpletypes => styles}/tab.md (100%) diff --git a/docs/usage/simpletypes/tab.md b/docs/usage/styles/tab.md similarity index 100% rename from docs/usage/simpletypes/tab.md rename to docs/usage/styles/tab.md From 30ae84b9a8a1a2d32b9755ba9b0f080134900cb7 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 22:19:31 -0500 Subject: [PATCH 080/110] Update paragraph.md --- docs/usage/styles/paragraph.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index 58f4201ddb..7a6d10d22f 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -53,7 +53,7 @@ See [`Sample_01_SimpleText`](/samples/Sample_01_SimpleText.php) and [`Sample_08_ * See [`SimpleType > LineSpacingRule`](../simpletypes/linespacingrule.md) class constants for possible values. - `suppressAutoHyphens`. Hyphenation for paragraph, *true* or *false*. - `tabs`. Set of custom tab stops. - * See [`Style > Tab`](../styles/tabs.md). + * See [`Style > Tab`](../styles/tab.md). - `widowControl`. Allow first/last line to display on a separate page, *true* or *false*. - `textAlignment`. Vertical Character Alignment on Line. * See [`SimpleType > TextAlignment`](/docs/usage/simpletypes/textalignment.md) class constants for possible values. From fcda6e938f7b862bc8373eae47817cce0c602dda Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 21 Sep 2025 22:26:03 -0500 Subject: [PATCH 081/110] Update 1.5.0.md --- docs/changes/1.x/1.5.0.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changes/1.x/1.5.0.md b/docs/changes/1.x/1.5.0.md index b96865bada..2a8643516c 100644 --- a/docs/changes/1.x/1.5.0.md +++ b/docs/changes/1.x/1.5.0.md @@ -11,9 +11,10 @@ ### Miscellaneous - Update phpstan/phpstan requirement from ^0.12.88 || ^1.0.0 to ^0.12.88 || ^1.0.0 || ^2.0.0 by [@dependabot](https://github.com/dependabot) & [@Progi1984](https://github.com/Progi1984) in [#2736](https://github.com/PHPOffice/PHPWord/pull/2736) +- Updated usage documentation, particularly in the style section, by [@rasamassen](https://github.com/rasamassen) in [#2831](https://github.com/PHPOffice/PHPWord/pull/2831) ### Deprecations ### BC Breaks -### Notes \ No newline at end of file +### Notes From a25e90fc783074d51b2f7105d3faa22cea960de2 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Tue, 23 Sep 2025 22:40:41 -0500 Subject: [PATCH 082/110] Update section.md - clarification on orientation --- docs/usage/styles/section.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/usage/styles/section.md b/docs/usage/styles/section.md index 9041710b6a..61ab196200 100644 --- a/docs/usage/styles/section.md +++ b/docs/usage/styles/section.md @@ -25,6 +25,7 @@ See [`Sample_03_Sections`](/samples/Sample_03_Sections.php) for more code sample - `lineNumbering`. Line numbering. * See [`Style > LineNumbering`](../styles/linenumbering.md) for possible values. - `orientation`. Page orientation. `ORIENTATION_PORTRAIT` is default. + * **IMPORTANT**: Orientation must be set *after* paperSize, pageSizeH, and pageSizeW to work. * See constants above for possible values. - `pageNumberingStart`. Starting page number. - `pageSizeH`. Page height in *twip*. `16837.79527559` is default. From a3f6c93a8a8b033e7ee8603868c5f80fcd970387 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Fri, 26 Sep 2025 18:49:03 -0500 Subject: [PATCH 083/110] Create styles.md --- docs/usage/styles.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 docs/usage/styles.md diff --git a/docs/usage/styles.md b/docs/usage/styles.md new file mode 100644 index 0000000000..fe0e1cf2a6 --- /dev/null +++ b/docs/usage/styles.md @@ -0,0 +1,33 @@ +# Styles + +Styles can be added to various elements either by including them with the element or by adding the style to the PhpWord document. + +## Defining Styles + +``` php +addFontStyle('Subtitle', + array('name' => 'Tahoma', 'size' => 16, 'color' => '1B2232', 'bold' => true), + array('spacing' => 240, 'lineHeight' => 1.5, 'align' => JcType::Both), +); + +// Add a title style by level with optionally included paragraph styling +$phpWord->addTitleStyle(0, + array('name' => 'Arial', 'size' => 24, 'color' => '1B2232', 'bold' => true), + array('spacing' => 480, 'lineHeight' => 2, 'align' => JcType::Both), +); + +``` + +## PHPWord Style Functions + +## PHPWord Style Classes +- [`Style > Border`](styles/border.md). + From 9ea33af11ca062ff65434fa10d8a7f69cf48039b Mon Sep 17 00:00:00 2001 From: rasamassen Date: Fri, 26 Sep 2025 19:28:27 -0500 Subject: [PATCH 084/110] Update styles.md --- docs/usage/styles.md | 93 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 78 insertions(+), 15 deletions(-) diff --git a/docs/usage/styles.md b/docs/usage/styles.md index fe0e1cf2a6..23ceeab890 100644 --- a/docs/usage/styles.md +++ b/docs/usage/styles.md @@ -1,33 +1,96 @@ # Styles -Styles can be added to various elements either by including them with the element or by adding the style to the PhpWord document. +Styles can be added to various elements either by including them with the element or by adding the style to the PHPWord document. -## Defining Styles +## Basic Example ``` php addFontStyle('Subtitle', - array('name' => 'Tahoma', 'size' => 16, 'color' => '1B2232', 'bold' => true), - array('spacing' => 240, 'lineHeight' => 1.5, 'align' => JcType::Both), -); - -// Add a title style by level with optionally included paragraph styling -$phpWord->addTitleStyle(0, +$phpWord->addFontStyle('subtitle', array('name' => 'Arial', 'size' => 24, 'color' => '1B2232', 'bold' => true), array('spacing' => 480, 'lineHeight' => 2, 'align' => JcType::Both), ); +// Set the styles when adding an element. +$sectionStyle = ['paperSize' => 'Letter', 'vAlign' => VerticalType::CENTER]; +$section = $phpWord->addSection($sectionStyle); + +// Use a document level style. +$section->addText('Hello, World!', 'subtitle'); + +``` + +## Document Styles + +Document styles can be set by using the following functions. + +``` php +setDefaultFontName('Times New Roman'); +$phpWord->setDefaultFontColor('FF0000'); +$phpWord->setDefaultFontSize(12); +$phpWord->setDefaultAsianFontName('標楷體'); +$phpWord->setDefaultParagraphStyle($paragraphStyle); + +// Add Styles +$phpWord->addParagraphStyle($name, $paragraphStyle); +$phpWord->addFontStyle($name, $fontStyle, [$paragraphStyle]); +$phpWord->addLinkStyle($name, $linkStyle); +$phpWord->addNumberingStyle($name, $numberingStyle); +$phpWord->addTitleStyle($depth, $fontStyle, [$paragraphStyle]); +$phpWord->addTableStyle($name, $tableStyle, [$firstRowStyle]); + ``` +- `$name`. Name of the style. + * The names of all styles must be unique, regardless of style type. + * The names *normal*, *title*, and *heading* (including *heading_#*, where # is the `$depth`) are reserved. Use `setDefaultParagraphStyle` and `addTitleStyle` to set those names. +- `$depth`. Outline level of Title. See [`Elements > Title`](elements/title.md). +- `$fontStyle`. See [`Styles > Font`](styles/font.md). +- `$linkStyle`. See [`Styles > Link`](styles/link.md). +- `$numberingStyle`. See [`Styles > Numbering`](styles/numbering.md). +- `$paragraphStyle`. See [`Styles > Paragraph`](styles/paragraph.md). +- `$tableStyle`. See [`Styles > Table`](styles/table.md). +- `$firstRowStyle`. See [`Styles > Row`](styles/table.md). -## PHPWord Style Functions +When adding font and paragraph styles, consider adding them in the following order to improve the end experience: +- Titles, using `addTitleStyle()`. +- Font and paragraph style combinations, using `addFontStyle()`. +- Paragraph styles based on other styles, using `addParagraphStyle()` with the `basedOn` keyword. +- Unique font and paragraph styles, using `addFontStyle()` and `addParagraphStyle()`. ## PHPWord Style Classes - [`Style > Border`](styles/border.md). +- [`Style > Cell`](styles/table.md). +- [`Style > Chart`](styles/chart.md). +- `Style > Extrusion`. +- `Style > Fill`. +- [`Style > Font`](styles/font.md). +- `Style > Frame`. +- [`Style > Image`](styles/image.md). +- [`Style > Indentation`](styles/indentation.md). +- [`Style > Language`](styles/language.md). +- `Style > Line`. +- [`Style > LineNumbering`](styles/linenumbering.md). +- [`Style > ListItem`](styles/list.md). +- [`Style > Numbering`](styles/numbering.md). +- `Style > NumberingLevel`. +- `Style > Outline`. +- [`Style > Paper`](styles/paper.md). +- [`Style > Paragraph`](styles/paragraph.md). +- [`Style > Row`](styles/table.md). +- [`Style > Section`](styles/section.md). +- `Style > Shading`. +- `Style > Shadow`. +- `Style > Shape`. +- `Style > Spacing`. +- `Style > TOC`. +- [`Style > Tab`](styles/tab.md). +- [`Style > Table`](styles/table.md). +- [`Style > TablePosition`](styles/table.md). +- `Style > TextBox`. From 2c40e0d8e9e13bf5f7562e511d5208f848156bfc Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 28 Sep 2025 14:51:14 -0500 Subject: [PATCH 085/110] Update index.md - added missing items to chart, fixed issues. --- docs/usage/elements/index.md | 84 +++++++++++++++++++++++++----------- 1 file changed, 59 insertions(+), 25 deletions(-) diff --git a/docs/usage/elements/index.md b/docs/usage/elements/index.md index 6106c8914b..adc5569014 100644 --- a/docs/usage/elements/index.md +++ b/docs/usage/elements/index.md @@ -1,34 +1,68 @@ # Elements +Elements are objects representing the various parts of a document. Elements can be [containers](containers.md) for other elements. + +## Basic Example + +``` php +addSection(); +$table = $section->addTable(); + +// Elements are added to containers without creating variables. +$section->addTitle(0, 'Hello, World!'); +$section->addText('How are you doing?'); + +``` + +## PHPWord Elements Below are the matrix of element availability in each container. The column shows the containers while the rows lists the elements. -| Num | Element | Section | Header | Footer | Cell | Text Run | Footnote | -|-------|-----------------|-----------|----------|----------|---------|------------|------------| -| 1 | [Text](text.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| 2 | Text Run | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :red_circle: | :red_circle: | -| 3 | [Link](link.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| 4 | [Title](title.md) | :white_check_mark: | :question: | :question: | :question: | :question: | :question: | -| 5 | [Preserve Text](preservetext.md) | :question: | :white_check_mark: | :white_check_mark: | :material-check-decagram-outline: | :red_circle: | :red_circle: | -| 6 | [Text Break](textbreak.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| 7 | [Page Break](pagebreak.md) | :white_check_mark: | :red_circle: | :red_circle: | :red_circle: | :red_circle: | :red_circle: | -| 8 | [List](list.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :red_circle: | :red_circle: | -| 9 | [Table](table.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :red_circle: | :red_circle: | -| 10 | [Image](image.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| 11 | [Watermark](watermark.md) | :red_circle: | :white_check_mark: | :red_circle: | :red_circle: | :red_circle: | :red_circle: | -| 12 | [OLEObject](oleobject.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| 13 | [TOC](toc.md) | :white_check_mark: | :red_circle: | :red_circle: | :red_circle: | :red_circle: | :red_circle: | -| 14 | [Footnote](note.md) | :white_check_mark: | :red_circle: | :red_circle: | :material-check-decagram: | :material-check-decagram: | :red_circle: | -| 15 | [Endnote](note.md) | :white_check_mark: | :red_circle: | :red_circle: | :material-check-decagram: | :material-check-decagram: | :red_circle: | -| 16 | [CheckBox](checkbox.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :red_circle: | -| 17 | [TextBox](textbox.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :red_circle: | :red_circle: | -| 18 | [Field](field.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| 19 | [Line](line.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| 20 | [Chart](chart.md) | :white_check_mark: | | | :white_check_mark: | | | +| | [Section](..containers.md) | [Header](..containers.md) | [Footer](..containers.md) | [Cell](table.md)
[Text Box](textbox.md) | [Text Run](text.md)
[List Item Run](list.md) | [Endnote](note.md)
[Footnote](note.md) | +|---|---|---|---|---|---|---| +| Bookmark | :question: | :question: | :question: | :question: | :question: | :question: | +| [Chart](chart.md) | :white_check_mark: | :question: | :question: | :white_check_mark: | :question: | :red_circle: | :question: | +| [CheckBox](checkbox.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :red_circle: | +| [Endnote](note.md) | :white_check_mark: | :red_circle: | :red_circle: | :ballot_box_with_check: | :ballot_box_with_check: | :red_circle: | +| [Field](field.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| [Footer](..containers.md) | :white_check_mark: | :red_circle: | :red_circle: | :red_circle: | :red_circle: | :red_circle: | +| FormField | :question: | :question: | :question: | :question: | :question: | :question: | +| [Footnote](note.md) | :white_check_mark: | :red_circle: | :red_circle: | :ballot_box_with_check: | :ballot_box_with_check: | :red_circle: | +| [Formula](formula.md) | :question: | :question: | :question: | :question: | :question: | :question: | +| [Header](..containers.md) | :white_check_mark: | :red_circle: | :red_circle: | :red_circle: | :red_circle: | :red_circle: | +| [Image](image.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| [Line](line.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| [Link](link.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| [List Item](list.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :red_circle: | :red_circle: | +| [List Item Run](list.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :red_circle: | :red_circle: | +| [OLEObject](oleobject.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| [Page Break](pagebreak.md) | :white_check_mark: | :red_circle: | :red_circle: | :red_circle: | :red_circle: | :red_circle: | +| [Preserve Text](preservetext.md) | :question: | :white_check_mark: | :white_check_mark: | :heavy_check_mark: | :red_circle: | :red_circle: | +| [Ruby](ruby.md) | :question: | :question: | :question: | :question: | :question: | :question: | +| SDT | :question: | :question: | :question: | :question: | :question: | :question: | +| Shape | :question: | :question: | :question: | :question: | :question: | :question: | +| [TOC](toc.md) | :white_check_mark: | :red_circle: | :red_circle: | :red_circle: | :red_circle: | :red_circle: | +| [Table](table.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :red_circle: | :red_circle: | +| [Text](text.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| [Text Break](textbreak.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| [Text Box](textbox.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :red_circle: | :red_circle: | +| [Text Run](text.md) | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :red_circle: | :white_check_mark: | +| [Title](title.md) | :white_check_mark: | :question: | :question: | :question: | :question: | :question: | +| [Watermark](watermark.md) | :red_circle: | :white_check_mark: | :red_circle: | :red_circle: | :red_circle: | :red_circle: | Legend: - :white_check_mark: : Available. -- :material-check-decagram-outline: : Available only when inside header/footer. -- :material-check-decagram: : Available only when inside section. +- :heavy_check_mark: : Available only when inside header/footer. +- :ballot_box_with_check: : Available only when inside section. - :red_circle: : Not available. -- :question: : Should be available. \ No newline at end of file +- :question: : Should be available. + +# Unique Elements +See each of the following elements for details on how to use them. + +- [Row](table.md) and [Cell](table.md) can only be added to a [Table](table.md). +- [Comment](comment.md) +- [Track Change](trackchanges.md) From 8358ded64c34172f536c3d072ac4f3d52805228a Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 28 Sep 2025 14:51:37 -0500 Subject: [PATCH 086/110] Rename docs/usage/styles.md to docs/usage/styles/index.md --- docs/usage/{styles.md => styles/index.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/usage/{styles.md => styles/index.md} (100%) diff --git a/docs/usage/styles.md b/docs/usage/styles/index.md similarity index 100% rename from docs/usage/styles.md rename to docs/usage/styles/index.md From 3129249ab6d1f675cc4bf9af0c955a386e24a846 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 28 Sep 2025 14:52:19 -0500 Subject: [PATCH 087/110] Create settings.md --- docs/usage/settings.md | 316 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 316 insertions(+) create mode 100644 docs/usage/settings.md diff --git a/docs/usage/settings.md b/docs/usage/settings.md new file mode 100644 index 0000000000..9f3f1a33ef --- /dev/null +++ b/docs/usage/settings.md @@ -0,0 +1,316 @@ +## PHPWord Settings + +The ``PhpOffice\PhpWord\Settings`` class provides some options that will +affect the behavior of PHPWord. Below are the options. + +### XML Writer compatibility + +This option sets [XMLWriter::setIndent](http://www.php.net/manual/en/function.xmlwriter-set-indent.php) and [XMLWriter::setIndentString](http://www.php.net/manual/en/function.xmlwriter-set-indent-string.php>). The default value of this option is ``true`` (compatible), which is [required for OpenOffice](https://github.com/PHPOffice/PHPWord/issues/103) to render OOXML document correctly. You can set this option to ``false`` during development to make the resulting XML file easier to read. + +``` php +setDefaultFontName('Times New Roman'); +$phpWord->setDefaultFontColor('FF0000'); +$phpWord->setDefaultFontSize(12); +``` + +Or you can specify Asian Font + +``` php +setDefaultAsianFontName('標楷體'); +``` + +## Document settings + +Settings for the generated document can be set using ``$phpWord->getSettings()`` + +### Magnification Setting + +The default zoom value is 100 percent. This can be changed either to another percentage + +``` php +getSettings()->setZoom(75); +``` + +Or to predefined values ``fullPage``, ``bestFit``, ``textFit`` + +``` php +getSettings()->setZoom(Zoom::BEST_FIT); +``` + +### Mirroring the Page Margins + +Use mirror margins to set up facing pages for double-sided documents, such as books or magazines. + +``` php +getSettings()->setMirrorMargins(true); +``` + +!!! note annotate "Don't forget to set both paper size and page size" + + For example, to print a document on A4 paper (landscape) and fold it into A5 pages (portrait), use this section style: + + ``` php + getSettings()->setMirrorMargins(true); + $phpWord->addSection([ + 'paperSize' => 'A4', + 'orientation' => 'landscape', + 'pageSizeW' => Converter::cmToTwip(14.85), + 'pageSizeH' => Converter::cmToTwip(21), + ]); + ``` + +### Printing as folded booklet + +Use book-fold printing to set up documents to be printed as foldable pages. + +``` php +getSettings()->setBookFoldPrinting(true); +``` + +### Spelling and grammatical checks + +By default spelling and grammatical errors are shown as soon as you open a word document. +For big documents this can slow down the opening of the document. You can hide the spelling and/or grammatical errors with: + +``` php +getSettings()->setHideGrammaticalErrors(true); +$phpWord->getSettings()->setHideSpellingErrors(true); +``` + +You can also specify the status of the spell and grammar checks, marking spelling or grammar as dirty will force a re-check when opening the document. + +``` php +setGrammar(\PhpOffice\PhpWord\ComplexType\ProofState::CLEAN); +$proofState->setSpelling(\PhpOffice\PhpWord\ComplexType\ProofState::DIRTY); + +$phpWord->getSettings()->setProofState($proofState); +``` + +### Track Revisions + +Track changes can be activated using ``setTrackRevisions``, you can furture specify + +- Not to use move syntax, instead moved items will be seen as deleted in one place and added in another +- Not track formatting revisions + +``` php +getSettings()->setTrackRevisions(true); +$phpWord->getSettings()->setDoNotTrackMoves(true); +$phpWord->getSettings()->setDoNotTrackFormatting(true); +``` + +### Decimal Symbol + +The default symbol to represent a decimal figure is the ``.`` in english. In french you might want to change it to ``,`` for instance. + +``` php +getSettings()->setDecimalSymbol(','); +``` + +### Document Language + +The default language of the document can be change with the following. + +``` php +getSettings()->setThemeFontLang(new Language(Language::FR_BE)); +``` + +``Language`` has 3 parameters, one for Latin languages, one for East Asian languages and one for Complex (Bi-Directional) languages. +A couple of language codes are provided in the ``PhpOffice\PhpWord\Style\Language`` class but any valid code/ID can be used. + +In case you are generating an RTF document the language need to be set differently. + +``` php +setLangId(Language::EN_GB_ID); +$phpWord->getSettings()->setThemeFontLang($lang); +``` + +## Document information + +You can set the document information such as title, creator, and company +name. Use the following functions: + +``` php +getDocInfo(); +$properties->setCreator('My name'); +$properties->setCompany('My factory'); +$properties->setTitle('My title'); +$properties->setDescription('My description'); +$properties->setCategory('My category'); +$properties->setLastModifiedBy('My name'); +$properties->setCreated(mktime(0, 0, 0, 3, 12, 2014)); +$properties->setModified(mktime(0, 0, 0, 3, 14, 2014)); +$properties->setSubject('My subject'); +$properties->setKeywords('my, key, word'); +``` + +## Measurement units + +The base length unit in Open Office XML is twip. Twip means "TWentieth +of an Inch Point", i.e. 1 twip = 1/1440 inch. + +You can use PHPWord helper functions to convert inches, centimeters, or +points to twip. + +``` php +addParagraphStyle('My Style', array( + 'spaceAfter' => \PhpOffice\PhpWord\Shared\Converter::pointToTwip(6)) +); + +$section = $phpWord->addSection(); +$sectionStyle = $section->getStyle(); +// half inch left margin +$sectionStyle->setMarginLeft(\PhpOffice\PhpWord\Shared\Converter::inchToTwip(.5)); +// 2 cm right margin +$sectionStyle->setMarginRight(\PhpOffice\PhpWord\Shared\Converter::cmToTwip(2)); +``` + +## Document protection + +The document (or parts of it) can be password protected. + +``` php +getSettings()->getDocumentProtection(); +$documentProtection->setEditing(DocProtect::READ_ONLY); +$documentProtection->setPassword('myPassword'); +``` + +## Automatically Recalculate Fields on Open + +To force an update of the fields present in the document, set updateFields to true + +``` php +getSettings()->setUpdateFields(true); +``` + +## Hyphenation + +Hyphenation describes the process of breaking words with hyphens. There are several options to control hyphenation. + +### Auto hyphenation + +To automatically hyphenate text set ``autoHyphenation`` to ``true``. + +``` php +getSettings()->setAutoHyphenation(true); +``` + +### Consecutive Hyphen Limit + +The maximum number of consecutive lines of text ending with a hyphen can be controlled by the ``consecutiveHyphenLimit`` option. +There is no limit if the option is not set or the provided value is ``0``. + +``` php +getSettings()->setConsecutiveHyphenLimit(2); +``` + +### Hyphenation Zone + +The hyphenation zone (in *twip*) is the allowed amount of whitespace before hyphenation is applied. +The smaller the hyphenation zone the more words are hyphenated. Or in other words, the wider the hyphenation zone the less words are hyphenated. + +``` php +getSettings()->setHyphenationZone(\PhpOffice\PhpWord\Shared\Converter::cmToTwip(1)); +``` + +### Hyphenate Caps + +To control whether or not words in all capital letters shall be hyphenated use the `doNotHyphenateCaps` option. + +``` php +getSettings()->setDoNotHyphenateCaps(true); +``` From 4d0383c80ae2e5c91e773d42781cf43e2fb2ae66 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 28 Sep 2025 15:01:15 -0500 Subject: [PATCH 088/110] Update introduction.md - make Intro a linking document connecting all other files in usage. --- docs/usage/introduction.md | 328 ++----------------------------------- 1 file changed, 12 insertions(+), 316 deletions(-) diff --git a/docs/usage/introduction.md b/docs/usage/introduction.md index 19d6aff51f..88414951ac 100644 --- a/docs/usage/introduction.md +++ b/docs/usage/introduction.md @@ -74,319 +74,15 @@ $objWriter->save('helloWorld.html'); /* Note: we skip PDF, because "HTML-to-PDF" approach is used to create PDF documents. */ ``` -## PHPWord Settings - -The ``PhpOffice\PhpWord\Settings`` class provides some options that will -affect the behavior of PHPWord. Below are the options. - -### XML Writer compatibility - -This option sets [XMLWriter::setIndent](http://www.php.net/manual/en/function.xmlwriter-set-indent.php) and [XMLWriter::setIndentString](http://www.php.net/manual/en/function.xmlwriter-set-indent-string.php>). The default value of this option is ``true`` (compatible), which is [required for OpenOffice](https://github.com/PHPOffice/PHPWord/issues/103) to render OOXML document correctly. You can set this option to ``false`` during development to make the resulting XML file easier to read. - -``` php -setDefaultFontName('Times New Roman'); -$phpWord->setDefaultFontColor('FF0000'); -$phpWord->setDefaultFontSize(12); -``` - -Or you can specify Asian Font - -``` php -setDefaultAsianFontName('標楷體'); -``` - -## Document settings - -Settings for the generated document can be set using ``$phpWord->getSettings()`` - -### Magnification Setting - -The default zoom value is 100 percent. This can be changed either to another percentage - -``` php -getSettings()->setZoom(75); -``` - -Or to predefined values ``fullPage``, ``bestFit``, ``textFit`` - -``` php -getSettings()->setZoom(Zoom::BEST_FIT); -``` - -### Mirroring the Page Margins - -Use mirror margins to set up facing pages for double-sided documents, such as books or magazines. - -``` php -getSettings()->setMirrorMargins(true); -``` - -!!! note annotate "Don't forget to set both paper size and page size" - - For example, to print a document on A4 paper (landscape) and fold it into A5 pages (portrait), use this section style: - - ``` php - getSettings()->setMirrorMargins(true); - $phpWord->addSection([ - 'paperSize' => 'A4', - 'orientation' => 'landscape', - 'pageSizeW' => Converter::cmToTwip(14.85), - 'pageSizeH' => Converter::cmToTwip(21), - ]); - ``` - -### Printing as folded booklet - -Use book-fold printing to set up documents to be printed as foldable pages. - -``` php -getSettings()->setBookFoldPrinting(true); -``` - -### Spelling and grammatical checks - -By default spelling and grammatical errors are shown as soon as you open a word document. -For big documents this can slow down the opening of the document. You can hide the spelling and/or grammatical errors with: - -``` php -getSettings()->setHideGrammaticalErrors(true); -$phpWord->getSettings()->setHideSpellingErrors(true); -``` - -You can also specify the status of the spell and grammar checks, marking spelling or grammar as dirty will force a re-check when opening the document. - -``` php -setGrammar(\PhpOffice\PhpWord\ComplexType\ProofState::CLEAN); -$proofState->setSpelling(\PhpOffice\PhpWord\ComplexType\ProofState::DIRTY); - -$phpWord->getSettings()->setProofState($proofState); -``` - -### Track Revisions - -Track changes can be activated using ``setTrackRevisions``, you can furture specify - -- Not to use move syntax, instead moved items will be seen as deleted in one place and added in another -- Not track formatting revisions - -``` php -getSettings()->setTrackRevisions(true); -$phpWord->getSettings()->setDoNotTrackMoves(true); -$phpWord->getSettings()->setDoNotTrackFormatting(true); -``` - -### Decimal Symbol - -The default symbol to represent a decimal figure is the ``.`` in english. In french you might want to change it to ``,`` for instance. - -``` php -getSettings()->setDecimalSymbol(','); -``` - -### Document Language - -The default language of the document can be change with the following. - -``` php -getSettings()->setThemeFontLang(new Language(Language::FR_BE)); -``` - -``Language`` has 3 parameters, one for Latin languages, one for East Asian languages and one for Complex (Bi-Directional) languages. -A couple of language codes are provided in the ``PhpOffice\PhpWord\Style\Language`` class but any valid code/ID can be used. - -In case you are generating an RTF document the language need to be set differently. - -``` php -setLangId(Language::EN_GB_ID); -$phpWord->getSettings()->setThemeFontLang($lang); -``` - -## Document information - -You can set the document information such as title, creator, and company -name. Use the following functions: - -``` php -getDocInfo(); -$properties->setCreator('My name'); -$properties->setCompany('My factory'); -$properties->setTitle('My title'); -$properties->setDescription('My description'); -$properties->setCategory('My category'); -$properties->setLastModifiedBy('My name'); -$properties->setCreated(mktime(0, 0, 0, 3, 12, 2014)); -$properties->setModified(mktime(0, 0, 0, 3, 14, 2014)); -$properties->setSubject('My subject'); -$properties->setKeywords('my, key, word'); -``` - -## Measurement units - -The base length unit in Open Office XML is twip. Twip means "TWentieth -of an Inch Point", i.e. 1 twip = 1/1440 inch. - -You can use PHPWord helper functions to convert inches, centimeters, or -points to twip. - -``` php -addParagraphStyle('My Style', array( - 'spaceAfter' => \PhpOffice\PhpWord\Shared\Converter::pointToTwip(6)) -); - -$section = $phpWord->addSection(); -$sectionStyle = $section->getStyle(); -// half inch left margin -$sectionStyle->setMarginLeft(\PhpOffice\PhpWord\Shared\Converter::inchToTwip(.5)); -// 2 cm right margin -$sectionStyle->setMarginRight(\PhpOffice\PhpWord\Shared\Converter::cmToTwip(2)); -``` - -## Document protection - -The document (or parts of it) can be password protected. - -``` php -getSettings()->getDocumentProtection(); -$documentProtection->setEditing(DocProtect::READ_ONLY); -$documentProtection->setPassword('myPassword'); -``` - -## Automatically Recalculate Fields on Open - -To force an update of the fields present in the document, set updateFields to true - -``` php -getSettings()->setUpdateFields(true); -``` - -## Hyphenation - -Hyphenation describes the process of breaking words with hyphens. There are several options to control hyphenation. - -### Auto hyphenation - -To automatically hyphenate text set ``autoHyphenation`` to ``true``. - -``` php -getSettings()->setAutoHyphenation(true); -``` - -### Consecutive Hyphen Limit - -The maximum number of consecutive lines of text ending with a hyphen can be controlled by the ``consecutiveHyphenLimit`` option. -There is no limit if the option is not set or the provided value is ``0``. - -``` php -getSettings()->setConsecutiveHyphenLimit(2); -``` - -### Hyphenation Zone - -The hyphenation zone (in *twip*) is the allowed amount of whitespace before hyphenation is applied. -The smaller the hyphenation zone the more words are hyphenated. Or in other words, the wider the hyphenation zone the less words are hyphenated. - -``` php -getSettings()->setHyphenationZone(\PhpOffice\PhpWord\Shared\Converter::cmToTwip(1)); -``` - -### Hyphenate Caps - -To control whether or not words in all capital letters shall be hyphenated use the `doNotHyphenateCaps` option. - -``` php -getSettings()->setDoNotHyphenateCaps(true); -``` +## Using PHPWord + +You may load documents into PHPWord using: +- [Readers](readers.md). Read in an existing document. +- [Templates](template.md). Read in an existing document with {template} fields. + +You may output documents from PHPWord using: +- [Settings](settings.md). Manipulate the document settings. +- [Containers](containers.md). Add containers, such as sections, headers, and footers. +- [Elements](elements/index.md). Add elements to containers, such as text, tables, and charts. +- [Styles](styles/index.md). Adjust the styles of elements. +- [Writers](writers.md). Write the resulting document to a file. From e0ad0f17cb739d03b9660c5cab408894db794a17 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 28 Sep 2025 19:56:06 -0500 Subject: [PATCH 089/110] Create jctable.md --- docs/usage/simpletypes/jctable.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 docs/usage/simpletypes/jctable.md diff --git a/docs/usage/simpletypes/jctable.md b/docs/usage/simpletypes/jctable.md new file mode 100644 index 0000000000..79ac507870 --- /dev/null +++ b/docs/usage/simpletypes/jctable.md @@ -0,0 +1,9 @@ +# Table Justification + +## Constants +- `START`. Commonly known as *left*. +- `CENTER`. +- `END`. Commonly known as *right*. + +## Used In +- [`Style > Table`](../styles/table.md). From 01c7e3681fd746df398329bad5bfe896fb506f05 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 28 Sep 2025 20:04:34 -0500 Subject: [PATCH 090/110] Create tblwidth --- docs/usage/simpletypes/tblwidth | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 docs/usage/simpletypes/tblwidth diff --git a/docs/usage/simpletypes/tblwidth b/docs/usage/simpletypes/tblwidth new file mode 100644 index 0000000000..a155ab8f29 --- /dev/null +++ b/docs/usage/simpletypes/tblwidth @@ -0,0 +1,10 @@ +# Table Width + +## Constants +- `NIL`. No width. +- `AUTO`. Automatically determined width. +- `PERCENT`. Width in fiftieths of a percent. +- `TWIP`. Width in twentieths of a point. + +## Used In +- [`Style > Table`](../styles/table.md). From 40955f7b85344abc5cd1a1c05e84f0abcecd305d Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 28 Sep 2025 20:23:30 -0500 Subject: [PATCH 091/110] Update table.md - update to new format, add missing elements --- docs/usage/styles/table.md | 141 ++++++++++++++++++++++++------------- 1 file changed, 92 insertions(+), 49 deletions(-) diff --git a/docs/usage/styles/table.md b/docs/usage/styles/table.md index 1f82f3c638..2bf8db9843 100644 --- a/docs/usage/styles/table.md +++ b/docs/usage/styles/table.md @@ -1,49 +1,92 @@ -# Table - -Available Table style options: - -- ``alignment``. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012. - See ``\PhpOffice\PhpWord\SimpleType\JcTable`` and ``\PhpOffice\PhpWord\SimpleType\Jc`` class constants for possible values. -- ``bgColor``. Background color, e.g. '9966CC'. -- ``border(Top|Right|Bottom|Left)Color``. Border color, e.g. '9966CC'. -- ``border(Top|Right|Bottom|Left)Size``. Border size in *twip*. -- ``cellMargin(Top|Right|Bottom|Left)``. Cell margin in *twip*. -- ``indent``. Table indent from leading margin. Must be an instance of ``\PhpOffice\PhpWord\ComplexType\TblWidth``. -- ``width``. Table width in Fiftieths of a Percent or Twentieths of a Point. -- ``unit``. The unit to use for the width. One of ``\PhpOffice\PhpWord\SimpleType\TblWidth``. Defaults to *auto*. -- ``layout``. Table layout, either *fixed* or *autofit* See ``\PhpOffice\PhpWord\Style\Table`` for constants. -- ``cellSpacing`` Cell spacing in *twip* -- ``position`` Floating Table Positioning, see below for options -- ``bidiVisual`` Present table as Right-To-Left - -Floating Table Positioning options: - -- ``leftFromText`` Distance From Left of Table to Text in *twip* -- ``rightFromText`` Distance From Right of Table to Text in *twip* -- ``topFromText`` Distance From Top of Table to Text in *twip* -- ``bottomFromText`` Distance From Top of Table to Text in *twip* -- ``vertAnchor`` Table Vertical Anchor, one of ``\PhpOffice\PhpWord\Style\TablePosition::VANCHOR_*`` -- ``horzAnchor`` Table Horizontal Anchor, one of ``\PhpOffice\PhpWord\Style\TablePosition::HANCHOR_*`` -- ``tblpXSpec`` Relative Horizontal Alignment From Anchor, one of ``\PhpOffice\PhpWord\Style\TablePosition::XALIGN_*`` -- ``tblpX`` Absolute Horizontal Distance From Anchorin *twip* -- ``tblpYSpec`` Relative Vertical Alignment From Anchor, one of ``\PhpOffice\PhpWord\Style\TablePosition::YALIGN_*`` -- ``tblpY`` Absolute Vertical Distance From Anchorin *twip* - -Available Row style options: - -- ``cantSplit``. Table row cannot break across pages, *true* or *false*. -- ``exactHeight``. Row height is exact or at least. -- ``tblHeader``. Repeat table row on every new page, *true* or *false*. - -Available Cell style options: - -- ``bgColor``. Background color, e.g. '9966CC'. -- ``border(Top|Right|Bottom|Left)Color``. Border color, e.g. '9966CC'. -- ``border(Top|Right|Bottom|Left)Size``. Border size in *twip*. -- ``border(Top|Right|Bottom|Left)Style``. Border style. You can use constants from ``\PhpOffice\PhpWord\SimpleType\Border`` -- ``gridSpan``. Number of columns spanned. -- ``textDirection(btLr|tbRl)``. Direction of text. - You can use constants ``\PhpOffice\PhpWord\Style\Cell::TEXT_DIR_BTLR`` and ``\PhpOffice\PhpWord\Style\Cell::TEXT_DIR_TBRL`` -- ``valign``. Vertical alignment, *top*, *center*, *both*, *bottom*. -- ``vMerge``. *restart* or *continue*. -- ``width``. Cell width in *twip*. \ No newline at end of file +# Table, Row, and Cell + +``` php + '006699', 'borderSize' => 6, 'cellMargin' => 50]; +$firstRowStyle = ['bgColor' => '66BBFF']; +$phpWord->addTableStyle('myTable', $tableStyle, $firstRowStyle); +$table = $section->addTable('myTable'); + +``` + +See [`Sample_09_Tables`](/samples/Sample_09_Tables.php) for more code samples. + +## Table Constants +- Layout + * `LAYOUT_AUTO`. AutoFit table layout. + * `LAYOUT_FIXED`. Fixed width table layout. + +## Table Options +- `align`. Same as alignment. +- `alignment`. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012. + * See [`SimpleType > JcTable`](../simpletypes/jctable.md) and [`SimpleType > Jc`](../simpletypes/jc.md) for possible values. +- `bidiVisual` Present table as Right-To-Left +- `bgColor`. Background color, e.g. *9966CC*. +- `border(Top|Right|Bottom|Left|InsideH|InsideV)Color`. Border color, e.g. '9966CC'. +- `border(Top|Right|Bottom|Left|InsideH|InsideV)Size`. Border size in *twip*. +- `cellMargin(Top|Right|Bottom|Left)`. Cell margin in *twip*. +- `cellSpacing` Cell spacing in *twip* +- `columnWidths` Array of widths for each column. +- `indent`. Table indent from leading margin. Must be an instance of `\PhpOffice\PhpWord\ComplexType\TblWidth`. +- `layout`. Table layout, either *fixed* or *autofit*. Defaults to *autofit*. + * See constants above for possible values. +- `position` Floating Table Positioning, see below for options +- `shading`. Table Shading. +- `width`. Table width in Fiftieths of a Percent or Twentieths of a Point. +- `unit`. The unit to use for the width. Defaults to *auto*. + * See [`SimpleType > TblWidth`](../simpletypes/tblwidth.md) and [`SimpleType > TblWidth`](../simpletypes/tblwidth.md) for possible values. + +### Extends Border +- See [`Style > Border`](../styles/border.md) for additional options. + +## Floating Table Positioning Options +- `leftFromText` Distance From Left of Table to Text in *twip* +- `rightFromText` Distance From Right of Table to Text in *twip* +- `topFromText` Distance From Top of Table to Text in *twip* +- `bottomFromText` Distance From Top of Table to Text in *twip* +- `vertAnchor` Table Vertical Anchor, one of `\PhpOffice\PhpWord\Style\TablePosition::VANCHOR_*` +- `horzAnchor` Table Horizontal Anchor, one of `\PhpOffice\PhpWord\Style\TablePosition::HANCHOR_*` +- `tblpXSpec` Relative Horizontal Alignment From Anchor, one of `\PhpOffice\PhpWord\Style\TablePosition::XALIGN_*` +- `tblpX` Absolute Horizontal Distance From Anchorin *twip* +- `tblpYSpec` Relative Vertical Alignment From Anchor, one of `\PhpOffice\PhpWord\Style\TablePosition::YALIGN_*` +- `tblpY` Absolute Vertical Distance From Anchorin *twip* + +## Row Options +- `cantSplit`. Table row cannot break across pages, *true* or *false*. Default is *false*. +- `exactHeight`. Row height is exact or at least. Default is *false*. +- `tblHeader`. Repeat table row on every new page, *true* or *false*. Default is *false*. + +## Cell Constants +- Text Direction + * `TEXT_DIR_LRTB`. Left to Right, Top to Bottom. + * `TEXT_DIR_TBRL`. Top to Bottom, Right to Left. + * `TEXT_DIR_BTLR`. Bottom to Top, Left to Right. + * `TEXT_DIR_LRTBV`. Left to Right, Top to Bottom Rotated. + * `TEXT_DIR_TBRLV`. Top to Bottom, Right to Left Rotated. + * `TEXT_DIR_TBLRV`. Top to Bottom, Left to Right Rotated. +- Vertical merge (rowspan). + * `VMERGE_RESTART`. + * `VMERGE_CONTINUE`. +- Default Border Color. + * `DEFAULT_BORDER_COLOR`. *000000*. + +## Cell Options +- `bgColor`. Background color, e.g. '9966CC'. +- `gridSpan`. Number of columns spanned. +- `noWrap`. Prevent text from wrapping in the cell. Default is *true*. +- `padding(Top|Right|Bottom|Left)`. Cell padding in *twip*. +- `shading`. Cell Shading. +- `textDirection`. Direction of text. + * See constants above for possible values. +- `valign`. Vertical alignment, *top*, *center*, *both*, *bottom*. +- `vMerge`. *restart* or *continue*. +- `width`. Cell width in *twip*. +- `unit`. The unit to use for the width. Defaults to *auto*. + * See [`SimpleType > TblWidth`](../simpletypes/tblwidth.md) and [`SimpleType > TblWidth`](../simpletypes/tblwidth.md) for possible values. + +### Extends Border +- See [`Style > Border`](../styles/border.md) for additional options. + +## Used In +- [`Element > Table`](../elements/table.md). From 85674db94c31c8adc26f17e9fde59cf763850a48 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 28 Sep 2025 20:57:44 -0500 Subject: [PATCH 092/110] Update table.md - add additional sample link --- docs/usage/styles/table.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/styles/table.md b/docs/usage/styles/table.md index 2bf8db9843..0a21ca2e05 100644 --- a/docs/usage/styles/table.md +++ b/docs/usage/styles/table.md @@ -10,7 +10,7 @@ $table = $section->addTable('myTable'); ``` -See [`Sample_09_Tables`](/samples/Sample_09_Tables.php) for more code samples. +See [`Sample_09_Tables`](/samples/Sample_09_Tables.php) and [`Sample_21_TableRowRules`](/samples/Sample_21_TableRowRules.php) for more code samples. ## Table Constants - Layout From c2c72d6b83e70dc751fc140dd43b75efd694206f Mon Sep 17 00:00:00 2001 From: rasamassen Date: Mon, 29 Sep 2025 08:37:07 -0500 Subject: [PATCH 093/110] Update index.md - fixes checkmarks on table --- docs/index.md | 86 +++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/docs/index.md b/docs/index.md index 211fc31a79..8fa043951f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -43,31 +43,31 @@ Below are the supported features for each file formats. | Features | | OOXML | ODF | RTF | HTML | PDF | |---------------------------|----------------------|--------|-------|-------|--------|--------| -| **Document Properties** | Standard | :material-check: | :material-check: | :material-check: | :material-check: | :material-check: | -| | Custom | :material-check: | :material-check: | | | | -| **Element Type** | Text | :material-check: | :material-check: | :material-check: | :material-check: | :material-check: | -| | Text Run | :material-check: | :material-check: | :material-check: | :material-check: | :material-check: | -| | Title | :material-check: | :material-check: | | :material-check: | :material-check: | -| | Link | :material-check: | :material-check: | :material-check: | :material-check: | :material-check: | -| | Preserve Text | :material-check: | | | | | -| | Text Break | :material-check: | :material-check: | :material-check: | :material-check: | :material-check: | -| | Page Break | :material-check: | | :material-check: | | | -| | List | :material-check: | :material-check: | | | | -| | Table | :material-check: | :material-check: | :material-check: | :material-check: | :material-check: | -| | Image | :material-check: | :material-check: | :material-check: | :material-check: | | -| | Object | :material-check: | | | | | -| | Watermark | :material-check: | | | | | -| | Table of Contents | :material-check: | | | | | -| | Header | :material-check: | | | | | -| | Footer | :material-check: | | | | | -| | Footnote | :material-check: | | | :material-check: | | -| | Endnote | :material-check: | | | :material-check: | | -| | Comments | :material-check: | | | | | -| **Graphs** | 2D basic graphs | :material-check: | | | | | +| **Document Properties** | Standard | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| | Custom | :white_check_mark: | :white_check_mark: | | | | +| **Element Type** | Text | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| | Text Run | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| | Title | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| | Link | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| | Preserve Text | :white_check_mark: | | | | | +| | Text Break | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| | Page Break | :white_check_mark: | | :white_check_mark: | | | +| | List | :white_check_mark: | :white_check_mark: | | | | +| | Table | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| | Image | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | +| | Object | :white_check_mark: | | | | | +| | Watermark | :white_check_mark: | | | | | +| | Table of Contents | :white_check_mark: | | | | | +| | Header | :white_check_mark: | | | | | +| | Footer | :white_check_mark: | | | | | +| | Footnote | :white_check_mark: | | | :white_check_mark: | | +| | Endnote | :white_check_mark: | | | :white_check_mark: | | +| | Comments | :white_check_mark: | | | | | +| **Graphs** | 2D basic graphs | :white_check_mark: | | | | | | | 2D advanced graphs | | | | | | -| | 3D graphs | :material-check: | | | | | -| **Math** | OMML support | :material-check: | | | | | -| | MathML support | | :material-check: | | | | +| | 3D graphs | :white_check_mark: | | | | | +| **Math** | OMML support | :white_check_mark: | | | | | +| | MathML support | | :white_check_mark: | | | | | **Bonus** | Encryption | | | | | | | | Protection | | | | | | @@ -76,31 +76,31 @@ Below are the supported features for each file formats. | Features | | OOXML | DOC | ODF | RTF | HTML | |---------------------------|----------------------|--------|-------|-------|-------|-------| -| **Document Properties** | Standard | :material-check: | | | | | -| | Custom | :material-check: | | | | | -| **Element Type** | Text | :material-check: | :material-check: | :material-check: | :material-check: | :material-check: | -| | Text Run | :material-check: | | | | | -| | Title | :material-check: | | :material-check: | | | -| | Link | :material-check: | :material-check: | | | | -| | Preserve Text | :material-check: | | | | | -| | Text Break | :material-check: | :material-check: | | | | -| | Page Break | :material-check: | | | | | -| | List | :material-check: | | :material-check: | | :material-check: | -| | Table | :material-check: | | | | :material-check: | -| | Image | :material-check: | :material-check: | | | | +| **Document Properties** | Standard | :white_check_mark: | | | | | +| | Custom | :white_check_mark: | | | | | +| **Element Type** | Text | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| | Text Run | :white_check_mark: | | | | | +| | Title | :white_check_mark: | | :white_check_mark: | | | +| | Link | :white_check_mark: | :white_check_mark: | | | | +| | Preserve Text | :white_check_mark: | | | | | +| | Text Break | :white_check_mark: | :white_check_mark: | | | | +| | Page Break | :white_check_mark: | | | | | +| | List | :white_check_mark: | | :white_check_mark: | | :white_check_mark: | +| | Table | :white_check_mark: | | | | :white_check_mark: | +| | Image | :white_check_mark: | :white_check_mark: | | | | | | Object | | | | | | | | Watermark | | | | | | | | Table of Contents | | | | | | -| | Header | :material-check: | | | | | -| | Footer | :material-check: | | | | | -| | Footnote | :material-check: | | | | | -| | Endnote | :material-check: | | | | | -| | Comments | :material-check: | | | | | +| | Header | :white_check_mark: | | | | | +| | Footer | :white_check_mark: | | | | | +| | Footnote | :white_check_mark: | | | | | +| | Endnote | :white_check_mark: | | | | | +| | Comments | :white_check_mark: | | | | | | **Graphs** | 2D basic graphs | | | | | | | | 2D advanced graphs | | | | | | | | 3D graphs | | | | | | -| **Math** | OMML support | :material-check: | | | | | -| | MathML support | | :material-check: | | | | +| **Math** | OMML support | :white_check_mark: | | | | | +| | MathML support | | :white_check_mark: | | | | | **Bonus** | Encryption | | | | | | | | Protection | | | | | | From 794675608ad5ec0936afbc23b8ca429669e8fd30 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Fri, 3 Oct 2025 19:50:53 -0500 Subject: [PATCH 094/110] Update paragraph.md --- docs/usage/styles/paragraph.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index 7a6d10d22f..1ae9025bff 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -51,7 +51,7 @@ See [`Sample_01_SimpleText`](/samples/Sample_01_SimpleText.php) and [`Sample_08_ - `spacing`. Space between lines in *twip*. If spacingLineRule is auto, 240 (height of 1 line) will be added, so if you want a double line height, set this to 240. - `spacingLineRule`. Line Spacing Rule. *auto*, *exact*, *atLeast* * See [`SimpleType > LineSpacingRule`](../simpletypes/linespacingrule.md) class constants for possible values. -- `suppressAutoHyphens`. Hyphenation for paragraph, *true* or *false*. +- `suppressAutoHyphens`. Hyphenation for paragraph, *true* or *false*. Only matters if [`Settings > AutoHyphenation](..settings.md) is *true*. - `tabs`. Set of custom tab stops. * See [`Style > Tab`](../styles/tab.md). - `widowControl`. Allow first/last line to display on a separate page, *true* or *false*. From 3988b944ab109cd8a03f26440ba0e1c8508e8435 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Fri, 3 Oct 2025 20:34:08 -0500 Subject: [PATCH 095/110] Update indentation.md - add warning about using both firstLine and hanging --- docs/usage/styles/indentation.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/usage/styles/indentation.md b/docs/usage/styles/indentation.md index 0473f849d5..78aa318fd1 100644 --- a/docs/usage/styles/indentation.md +++ b/docs/usage/styles/indentation.md @@ -17,5 +17,7 @@ See [`Sample_08_ParagraphPagination`](/samples/Sample_08_ParagraphPagination.php - `firstLineChars`. Additional first line chars indentation in *twip*. - `hanging`. Indentation removed from first line *twip*. +*Warning*: `firstLine[Chars]` and `hanging` cannot be used together. + ## Used In - [`Style > Paragraph`](../styles/paragraph.md). From 29a31f45f828056ae28b715429ab53d406bf66ae Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 4 Oct 2025 09:02:10 -0500 Subject: [PATCH 096/110] Update font.md --- docs/usage/styles/font.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/styles/font.md b/docs/usage/styles/font.md index 03d4c66210..dbb77dea41 100644 --- a/docs/usage/styles/font.md +++ b/docs/usage/styles/font.md @@ -41,7 +41,7 @@ See [`Sample_01_SimpleText`](/samples/Sample_01_SimpleText.php) for more code sa - `bold`. Bold, *true* or *false*. - `color`. Font color, e.g. *FF0000*. - `doubleStrikethrough`. Double strikethrough, *true* or *false*. -- `fallbackFont`. Fallback generic font for html/pdf. Possible values are *sans-serif*, *serif*, and *monospace* (other css values for generic fonts are accepted). +- `fallbackFont`. Fallback generic font. Possible values are *serif*, *sans-serif*, *monospace*, *cursive*, *fantasy*, *system-ui*, *math*, *emoji*, and *fangsong*. - `fgColor`. Font highlight color, e.g. *yellow*, *green*, *blue*. * See constants above for possible values. - `hidden`. Hidden text, *true* or *false*. From 94768747cb5367a7760a77de5f92981fa5cd0f5c Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 5 Oct 2025 15:04:50 -0500 Subject: [PATCH 097/110] Update paragraph.md - remove deprecated option --- docs/usage/styles/paragraph.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index 1ae9025bff..139acee402 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -29,7 +29,6 @@ See [`Sample_01_SimpleText`](/samples/Sample_01_SimpleText.php) and [`Sample_08_ - `basedOn`. Parent style. - `bidi`. Right to Left Paragraph Layout, *true* or *false*. - `contextualSpacing`. Ignore Spacing Above and Below When Using Identical Styles, *true* or *false*. -- `hanging`. Hanging indentation in *half inches*. - `indentation`. An array of indentation key => value pairs in *twip*. Supports *left*, *right*, *firstLine*, *firstLineChars* and *hanging* indentation. * See [`Style > Indentation`](../styles/indentation.md) for possible identation types. - `indentHanging`. Hanging indentation in *half inches*. From 4e86f25a1462c78e6f7d069a3781ecf841d47555 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 5 Oct 2025 19:24:56 -0500 Subject: [PATCH 098/110] Update Border.php - missing _ --- src/PhpWord/SimpleType/Border.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpWord/SimpleType/Border.php b/src/PhpWord/SimpleType/Border.php index acd1c1a1b1..03925e87d6 100644 --- a/src/PhpWord/SimpleType/Border.php +++ b/src/PhpWord/SimpleType/Border.php @@ -48,7 +48,7 @@ final class Border extends AbstractEnum const THIN_THICK_LARGE_GAP = 'thinThickLargeGap'; //A thin line contained within a thick line with a large-sized intermediate gap const THIN_THICK_MEDIUM_GAP = 'thinThickMediumGap'; //A thick line contained within a thin line with a medium-sized intermediate gap const THIN_THICK_SMALL_GAP = 'thinThickSmallGap'; //A thick line contained within a thin line with a small intermediate gap - const THIN_THICK_THINLARGE_GAP = 'thinThickThinLargeGap'; //A thin-thick-thin line with a large gap + const THIN_THICK_THIN_LARGE_GAP = 'thinThickThinLargeGap'; //A thin-thick-thin line with a large gap const THIN_THICK_THIN_MEDIUM_GAP = 'thinThickThinMediumGap'; //A thin-thick-thin line with a medium gap const THIN_THICK_THIN_SMALL_GAP = 'thinThickThinSmallGap'; //A thin-thick-thin line with a small gap const THREE_D_EMBOSS = 'threeDEmboss'; //A three-staged gradient line, getting darker towards the paragraph From 0c97fe6ca66323dacea670d42a10ed63908b989b Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 5 Oct 2025 19:25:07 -0500 Subject: [PATCH 099/110] Update border.md --- docs/usage/simpletypes/border.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/simpletypes/border.md b/docs/usage/simpletypes/border.md index 17917bb202..357da66225 100644 --- a/docs/usage/simpletypes/border.md +++ b/docs/usage/simpletypes/border.md @@ -21,7 +21,7 @@ - `THIN_THICK_LARGE_GAP`. A thin line contained within a thick line with a large-sized intermediate gap - `THIN_THICK_MEDIUM_GAP`. A thick line contained within a thin line with a medium-sized intermediate gap - `THIN_THICK_SMALL_GAP`. A thick line contained within a thin line with a small intermediate gap -- `THIN_THICK_THINLARGE_GAP`. A thin-thick-thin line with a large gap +- `THIN_THICK_THIN_LARGE_GAP`. A thin-thick-thin line with a large gap - `THIN_THICK_THIN_MEDIUM_GAP`. A thin-thick-thin line with a medium gap - `THIN_THICK_THIN_SMALL_GAP`. A thin-thick-thin line with a small gap - `THREE_D_EMBOSS`. A three-staged gradient line, getting darker towards the paragraph From a572ef5f9f0786e379ad185f1a43ca3072e9f221 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 5 Oct 2025 20:59:05 -0500 Subject: [PATCH 100/110] Update Border.php - Revert, handled in different pull request. --- src/PhpWord/SimpleType/Border.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpWord/SimpleType/Border.php b/src/PhpWord/SimpleType/Border.php index 03925e87d6..acd1c1a1b1 100644 --- a/src/PhpWord/SimpleType/Border.php +++ b/src/PhpWord/SimpleType/Border.php @@ -48,7 +48,7 @@ final class Border extends AbstractEnum const THIN_THICK_LARGE_GAP = 'thinThickLargeGap'; //A thin line contained within a thick line with a large-sized intermediate gap const THIN_THICK_MEDIUM_GAP = 'thinThickMediumGap'; //A thick line contained within a thin line with a medium-sized intermediate gap const THIN_THICK_SMALL_GAP = 'thinThickSmallGap'; //A thick line contained within a thin line with a small intermediate gap - const THIN_THICK_THIN_LARGE_GAP = 'thinThickThinLargeGap'; //A thin-thick-thin line with a large gap + const THIN_THICK_THINLARGE_GAP = 'thinThickThinLargeGap'; //A thin-thick-thin line with a large gap const THIN_THICK_THIN_MEDIUM_GAP = 'thinThickThinMediumGap'; //A thin-thick-thin line with a medium gap const THIN_THICK_THIN_SMALL_GAP = 'thinThickThinSmallGap'; //A thin-thick-thin line with a small gap const THREE_D_EMBOSS = 'threeDEmboss'; //A three-staged gradient line, getting darker towards the paragraph From 41a311e15900aa3c81bba38b5a21ed114b235c34 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 11 Oct 2025 19:23:58 -0500 Subject: [PATCH 101/110] Create spacing.md --- docs/usage/styles/spacing.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 docs/usage/styles/spacing.md diff --git a/docs/usage/styles/spacing.md b/docs/usage/styles/spacing.md new file mode 100644 index 0000000000..b01d869aa4 --- /dev/null +++ b/docs/usage/styles/spacing.md @@ -0,0 +1,21 @@ +# Spacing Styles + +``` php +addParagraphStyle('spacing', ['space' => ['before' => 120, 'after' => 240]]); +$section->addText('Hello, World!', null, 'spacing'); + +``` + +See [`Sample_08_ParagraphPagination`](/samples/Sample_08_ParagraphPagination.php) for more code samples. + +## Options +- `after`. Space after paragraph in *twip*. +- `before`. Space before paragraph in *twip*. +- `line`. Space between lines within a paragraph in *twip*. If lineRule is auto, 240 (height of 1 line) will be added, so if you want a double line height, set this to 240. +- `lineRule`. Line Spacing Rule. *auto*, *exact*, *atLeast* + * See [`SimpleType > LineSpacingRule`](../simpletypes/linespacingrule.md) class constants for possible values. + +## Used In +- [`Style > Paragraph`](../styles/paragraph.md). From abe3ca3692adcb099a63fe0952a3c732d2948933 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 11 Oct 2025 19:30:51 -0500 Subject: [PATCH 102/110] Update paragraph.md --- docs/usage/styles/paragraph.md | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index 139acee402..9979383228 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -29,27 +29,32 @@ See [`Sample_01_SimpleText`](/samples/Sample_01_SimpleText.php) and [`Sample_08_ - `basedOn`. Parent style. - `bidi`. Right to Left Paragraph Layout, *true* or *false*. - `contextualSpacing`. Ignore Spacing Above and Below When Using Identical Styles, *true* or *false*. -- `indentation`. An array of indentation key => value pairs in *twip*. Supports *left*, *right*, *firstLine*, *firstLineChars* and *hanging* indentation. - * See [`Style > Indentation`](../styles/indentation.md) for possible identation types. -- `indentHanging`. Hanging indentation in *half inches*. -- `indentFirstLine`. First line indentation in *half inches*. -- `indentFirstLineChars`. First line character indentation in *half inches*. -- `indentLeft`. Left indentation in *half inches*. -- `indentRight`. Right indentation in *half inches*. +- `indentation`. An array of indentation [key => value] pairs. + * See [`Style > Indentation`](../styles/indentation.md) for indentation options. + * The following options in paragraph are shortcuts to the indentation options. + * `indentHanging`. Hanging indentation in *half inches*. + * `indentFirstLine`. First line indentation in *half inches*. + * `indentFirstLineChars`. First line character indentation in *half inches*. + * `indentLeft`. Left indentation in *half inches*. + * `indentRight`. Right indentation in *half inches*. - `keepLines`. Keep all lines on one page, *true* or *false*. - `keepNext`. Keep paragraph with next paragraph, *true* or *false*. -- `lineHeight`. Text line height, e.g. *1.0*, *1.5*, etc. - `next`. Style for next paragraph. - `numLevel`. Numbering level. `0` is default. - `numStyle`. Numbering style name * See [`Style > Numbering`](../styles/numbering.md). - `pageBreakBefore`. Start paragraph on next page, *true* or *false*. -- `shading`. Paragraph Shading. -- `spaceAfter`. Space after paragraph in *twip*. -- `spaceBefore`. Space before paragraph in *twip*. -- `spacing`. Space between lines in *twip*. If spacingLineRule is auto, 240 (height of 1 line) will be added, so if you want a double line height, set this to 240. -- `spacingLineRule`. Line Spacing Rule. *auto*, *exact*, *atLeast* - * See [`SimpleType > LineSpacingRule`](../simpletypes/linespacingrule.md) class constants for possible values. +- `shading`. An array of shading [key => value] pairs. + * See [`Style > Shading`](../styles/shading.md) for shading options. +- `space`. An array of spacing [key => value] pairs. + * See [`Style > Spacing`](../styles/spacing.md) for spacing options. + * The following options in paragraph are shortcuts to the spacing options. + * `lineHeight`. Text line height, e.g. *1.0*, *1.5*, etc. + * `spaceAfter`. Space after paragraph in *twip*. + * `spaceBefore`. Space before paragraph in *twip*. + * `spacing`. Space between lines within a paragraph in *twip*. If spacingLineRule is auto, 240 (height of 1 line) will be added, so if you want a double line height, set this to 240. + * `spacingLineRule`. Line Spacing Rule. *auto*, *exact*, *atLeast* + - See [`SimpleType > LineSpacingRule`](../simpletypes/linespacingrule.md) class constants for possible values. - `suppressAutoHyphens`. Hyphenation for paragraph, *true* or *false*. Only matters if [`Settings > AutoHyphenation](..settings.md) is *true*. - `tabs`. Set of custom tab stops. * See [`Style > Tab`](../styles/tab.md). From 0ecc3510b9ee4f99e33802364a59eee449b99e5b Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 11 Oct 2025 19:34:09 -0500 Subject: [PATCH 103/110] Update spacing.md --- docs/usage/styles/spacing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/usage/styles/spacing.md b/docs/usage/styles/spacing.md index b01d869aa4..e33d36022f 100644 --- a/docs/usage/styles/spacing.md +++ b/docs/usage/styles/spacing.md @@ -3,8 +3,8 @@ ``` php addParagraphStyle('spacing', ['space' => ['before' => 120, 'after' => 240]]); -$section->addText('Hello, World!', null, 'spacing'); +$phpWord->addParagraphStyle('pStyle', ['space' => ['before' => 120, 'after' => 240]]); +$section->addText('Hello, World!', null, 'pStyle'); ``` From 1a285b80d0fb172fe24fc4957c5cf89112017845 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 11 Oct 2025 19:34:18 -0500 Subject: [PATCH 104/110] Update indentation.md --- docs/usage/styles/indentation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/usage/styles/indentation.md b/docs/usage/styles/indentation.md index 78aa318fd1..19049f415a 100644 --- a/docs/usage/styles/indentation.md +++ b/docs/usage/styles/indentation.md @@ -3,8 +3,8 @@ ``` php addParagraphStyle('line', ['indentation' => ['left' => 240, 'right' => 120]]); -$section->addText('Hello, World!', null, 'line'); +$phpWord->addParagraphStyle('pStyle', ['indentation' => ['left' => 240, 'right' => 120]]); +$section->addText('Hello, World!', null, 'pStyle'); ``` From d6b38fd0f23282c5b0867ffdfdf43b2672d0912a Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sat, 11 Oct 2025 19:36:56 -0500 Subject: [PATCH 105/110] Create shading.md --- docs/usage/styles/shading.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 docs/usage/styles/shading.md diff --git a/docs/usage/styles/shading.md b/docs/usage/styles/shading.md new file mode 100644 index 0000000000..b4aa3c0b19 --- /dev/null +++ b/docs/usage/styles/shading.md @@ -0,0 +1,28 @@ +# Shading Styles + +``` php +addParagraphStyle('pStyle', ['shading' => ['pattern' => Shading::PATTERN_SOLID, 'fill' => FF0000]]); +$section->addText('Hello, World!', null, 'pStyle'); + +``` + +## Constants +- `PATTERN_CLEAR`. No pattern. +- `PATTERN_SOLID`. 100% fill pattern. +- `PATTERN_HSTRIPE`. Horizontal stripe pattern. +- `PATTERN_VSTRIPE`. Vertical stripe pattern. +- `PATTERN_DSTRIPE`. Diagonal stripe pattern. +- `PATTERN_HCROSS`. Horizontal cross pattern. +- `PATTERN_DCROSS`. Diagonal cross pattern. + +## Options +- `color`. Shading pattern color, e.g. *FF0000*. +- `fill`. Shading background color, e.g. *FF0000*. +- `pattern`. Shading pattern. + * See constants above for possible values. + +## Used In +- [`Style > Paragraph`](../styles/paragraph.md). From b7c97db3b61eedfe8251fe203f63eb23eb6fa1da Mon Sep 17 00:00:00 2001 From: rasamassen Date: Wed, 15 Oct 2025 22:48:27 -0500 Subject: [PATCH 106/110] Update howto.md - add link to samples folder. --- docs/howto.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/howto.md b/docs/howto.md index fd4c860682..e7345f577a 100644 --- a/docs/howto.md +++ b/docs/howto.md @@ -1,5 +1,7 @@ # How to +See [`Samples`](https://github.com/PHPOffice/PHPWord/tree/master/samples/) for many more how to examples. + ## Create float left image Use absolute positioning relative to margin horizontally and to line vertically. From 9fb20fc640b0468702814973806106c1b4feded2 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 19 Oct 2025 13:21:15 -0500 Subject: [PATCH 107/110] Update numbering.md --- docs/usage/styles/numbering.md | 36 ++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/docs/usage/styles/numbering.md b/docs/usage/styles/numbering.md index e199ad470d..52ea883357 100644 --- a/docs/usage/styles/numbering.md +++ b/docs/usage/styles/numbering.md @@ -29,17 +29,45 @@ See [`Sample_14_ListItem`](/samples/Sample_14_ListItem.php) for more code sample - `align`. Same as alignment. - `alignment`. Supports all alignment modes since 1st Edition of ECMA-376 standard up till ISO/IEC 29500:2012. * See [`SimpleType > Jc`](../simpletypes/jc.md) for possible values. -- `font`. Font name, e.g. `Arial`. +- `font`. Font name, e.g. `Arial`. Applies only to the numbering level text, e.g. 1., IV), or a bullet. - `format`. Numbering format. * See [`SimpleType > NumberFormat`](../simpletypes/numberformat.md). -- `hanging`. Hanging in `twip`. +- `hanging`. Indentation removed from the first line in `twip`. - `hint`. Font content type, `default`, `eastAsia`, or `cs`. -- `left`. Left in `twip`. +- `left`. Left indentation in `twip`. - `restart`. Restart numbering level symbol. - `start`. Starting value. `1` is default. + * Always use integers for the starting value. If the `format` is `NumberFormat::UPPER_LETTER` and you want to start at `E`, then set `start` to 5. - `suffix`. Content between numbering symbol and paragraph text, `tab`, `space`, or `nothing`. `tab` is default. - `tabPos`. Tab position in `twip`. -- `text`. Numbering level text e.g. %1 for nonbullet or bullet character. +- `text`. Numbering level text, where `%#` will be replaced with the symbol for a particular level. + * If the `format` is `NumberFormat::DECIMAL`, `%1` will return the first-level number (1, 2, 3, 4), `%2` will return the second-level number, and so on. + * If the `format` is `NumberFormat::DECIMAL`, `%1.%2.` will return both the first-level and second level number with periods, 1.1., 1.2., 1.3., 1.4. + * If the `format` is `NumberFormat::UPPER_ROMAN`, `((%1))` will return the first-level upper roman character, ((I)), ((II)), ((III)), ((IV)). + * If the `format` is `NumberFormat::UPPER_ROMAN` for the first level and `NumberFormat::DECIMAL` for the second level, `%1.%2` will return IV.1, IV.2, IV.3 for second level items after IV. + * If the `format` is `NumberFormat::BULLET`, `#` will return #, `•` will return •, and `o` will return o. + * Regardless of `format`, `Item.` will return Item. + +## Bullets +For easy copying, here are some common bullet symbols using a standard unicode font. +- `•` Bullet +- `◦` Open bullet +- `·` Middle dot +- `o` Small letter o +- `●` Circle +- `○` Open circle +- `◌` Dotted circle +- `†` Dagger +- `‡` Double dagger +- `#` Number sign +- `§` Section sign +- `›` Single right arrow +- `»` Double right arrow +- `►` Right arrow +- `■` Square +- `□` Open square +- `▪` Small square +- `▫` Small open square ## Used In - [`Styles > ListItem`](../styles/list.md). From d90be5d1cb8fe40dbf9cb6b9415b191986298012 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Sun, 19 Oct 2025 13:46:38 -0500 Subject: [PATCH 108/110] Update list.md --- docs/usage/styles/list.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/usage/styles/list.md b/docs/usage/styles/list.md index 55466a6f23..4b77dcfc23 100644 --- a/docs/usage/styles/list.md +++ b/docs/usage/styles/list.md @@ -3,14 +3,20 @@ ``` php ListStyle::TYPE_NUMBER_NESTED]; -$section->addListItem('List Item 1', 0, null, $listStyle); +$numStyle = 'decimal'; +$phpWord->addNumberingStyle($numStyle, ['type' => 'singleLevel', 'levels' => [ + ['format' => 'decimal', 'text' => '%1.', 'left' => 360, 'hanging' => 360, 'tabPos' => 360], +]]); +$section->addListItem('List Item 1', 0, null, $numStyle); ``` See [`Sample_14_ListItem`](/samples/Sample_14_ListItem.php) for more code samples. -## Constants +## Options +- `numStyle`. Numbering style name. If no name is provided, a bullet list will be returned. + * See [`Styles > Numbering`](../styles/numbering.md) for possible values. + +## DEPRECATED Constants - `TYPE_SQUARE_FILLED`. - `TYPE_BULLET_FILLED`. - `TYPE_BULLET_EMPTY`. @@ -18,11 +24,9 @@ See [`Sample_14_ListItem`](/samples/Sample_14_ListItem.php) for more code sample - `TYPE_NUMBER_NESTED`. L1: 1., L2: 1.1., L3: 1.1.1. etc. - `TYPE_ALPHANUM`. L1: Decimal, L2: LowerLetter, L3: LowerRoman repeat. -## Options +## DEPRECATED Options - `listType`. Predefined numbering styles. * See constants above for possible values. -- `numStyle`. - * See [`Styles > Numbering`](../styles/numbering.md) for possible values. ## Used In - [`Element > ListItem`](../elements/list.md). From b774a57737fa730908cd909d6176fb6f8a11cedd Mon Sep 17 00:00:00 2001 From: rasamassen Date: Wed, 22 Oct 2025 21:04:19 -0500 Subject: [PATCH 109/110] Update numbering.md - add a couple more bullets --- docs/usage/styles/numbering.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/usage/styles/numbering.md b/docs/usage/styles/numbering.md index 52ea883357..bbcd0f7a19 100644 --- a/docs/usage/styles/numbering.md +++ b/docs/usage/styles/numbering.md @@ -61,6 +61,7 @@ For easy copying, here are some common bullet symbols using a standard unicode f - `‡` Double dagger - `#` Number sign - `§` Section sign +- `˃` Rigth arrowhead - `›` Single right arrow - `»` Double right arrow - `►` Right arrow @@ -68,6 +69,7 @@ For easy copying, here are some common bullet symbols using a standard unicode f - `□` Open square - `▪` Small square - `▫` Small open square +- `♦` Black suit diamond ## Used In - [`Styles > ListItem`](../styles/list.md). From a98821b690cdcc600c7c5f1209342426d594d052 Mon Sep 17 00:00:00 2001 From: rasamassen Date: Fri, 24 Oct 2025 21:20:39 -0500 Subject: [PATCH 110/110] Update paragraph.md - Fix missing ` --- docs/usage/styles/paragraph.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/styles/paragraph.md b/docs/usage/styles/paragraph.md index 9979383228..323eddc683 100644 --- a/docs/usage/styles/paragraph.md +++ b/docs/usage/styles/paragraph.md @@ -55,7 +55,7 @@ See [`Sample_01_SimpleText`](/samples/Sample_01_SimpleText.php) and [`Sample_08_ * `spacing`. Space between lines within a paragraph in *twip*. If spacingLineRule is auto, 240 (height of 1 line) will be added, so if you want a double line height, set this to 240. * `spacingLineRule`. Line Spacing Rule. *auto*, *exact*, *atLeast* - See [`SimpleType > LineSpacingRule`](../simpletypes/linespacingrule.md) class constants for possible values. -- `suppressAutoHyphens`. Hyphenation for paragraph, *true* or *false*. Only matters if [`Settings > AutoHyphenation](..settings.md) is *true*. +- `suppressAutoHyphens`. Hyphenation for paragraph, *true* or *false*. Only matters if [`Settings > AutoHyphenation`](..settings.md) is *true*. - `tabs`. Set of custom tab stops. * See [`Style > Tab`](../styles/tab.md). - `widowControl`. Allow first/last line to display on a separate page, *true* or *false*.