Skip to content

Commit cc9dfb8

Browse files
committed
add/setting page element border style.
1 parent ec1b3d3 commit cc9dfb8

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

src/PhpWord/Style/Border.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,41 @@
2222
*/
2323
class Border extends AbstractStyle
2424
{
25+
/**
26+
* Border Style Val.
27+
* Wordprocessing Paragraphs Borders
28+
* Specifies the style of the border. Paragraph borders can be only line borders. (Page borders can also be art borders.) Possible values are:
29+
* @see http://officeopenxml.com/WPborders.php
30+
* @const string
31+
*/
32+
const BORDER_STYLE_SINGLE = 'single'; //A single line
33+
const BORDER_STYLE_DASH_DOT_STROKED = 'dashDotStroked'; //A line with a series of alternating thin and thick strokes
34+
const BORDER_STYLE_DASHED = 'dashed'; //A dashed line
35+
const BORDER_STYLE_DASH_SMALL_GAP = 'dashSmallGap'; //A dashed line with small gaps
36+
const BORDER_STYLE_DOT_DASH = 'dotDash'; //A line with alternating dots and dashes
37+
const BORDER_STYLE_DOT_DOT_DASH = 'dotDotDash'; //A line with a repeating dot - dot - dash sequence
38+
const BORDER_STYLE_DOTTED = 'dotted'; //A dotted line
39+
const BORDER_STYLE_DOUBLE = 'double'; //A double line
40+
const BORDER_STYLE_DOUBLE_WAVE = 'doubleWave'; //A double wavy line
41+
const BORDER_STYLE_INSET = 'inset'; //An inset set of lines
42+
const BORDER_STYLE_NIL = 'nil'; //No border
43+
const BORDER_STYLE_NONE = 'none'; //No border
44+
const BORDER_STYLE_OUTSET = 'outset'; //An outset set of lines
45+
const BORDER_STYLE_THICK = 'thick'; //A single line
46+
const BORDER_STYLE_THICK_THIN_LARGE_GAP = 'thickThinLargeGap'; //A thick line contained within a thin line with a large-sized intermediate gap
47+
const BORDER_STYLE_THICK_THIN_MEDIUM_GAP = 'thickThinMediumGap'; //A thick line contained within a thin line with a medium-sized intermediate gap
48+
const BORDER_STYLE_THICK_THIN_SMALL_GAP = 'thickThinSmallGap'; //A thick line contained within a thin line with a small intermediate gap
49+
const BORDER_STYLE_THIN_THICK_LARGE_GAP = 'thinThickLargeGap'; //A thin line contained within a thick line with a large-sized intermediate gap
50+
const BORDER_STYLE_THIN_THICK_MEDIUM_GAP = 'thinThickMediumGap'; //A thick line contained within a thin line with a medium-sized intermediate gap
51+
const BORDER_STYLE_THIN_THICK_SMALL_GAP = 'thinThickSmallGap'; //A thick line contained within a thin line with a small intermediate gap
52+
const BORDER_STYLE_THIN_THICK_THINLARGE_GAP = 'thinThickThinLargeGap'; //A thin-thick-thin line with a large gap
53+
const BORDER_STYLE_THIN_THICK_THIN_MEDIUM_GAP = 'thinThickThinMediumGap'; //A thin-thick-thin line with a medium gap
54+
const BORDER_STYLE_THIN_THICK_THIN_SMALL_GAP = 'thinThickThinSmallGap'; //A thin-thick-thin line with a small gap
55+
const BORDER_STYLE_THREE_D_EMBOSS = 'threeDEmboss'; //A three-staged gradient line, getting darker towards the paragraph
56+
const BORDER_STYLE_THREE_D_ENGRAVE = 'threeDEngrave'; //A three-staged gradient like, getting darker away from the paragraph
57+
const BORDER_STYLE_TRIPLE = 'triple'; //A triple line
58+
const BORDER_STYLE_WAVE = 'wave'; //A wavy line
59+
2560
/**
2661
* Border Top Size
2762
*

src/PhpWord/Writer/Word2007/Style/Paragraph.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ private function writeStyle()
132132

133133
$styleWriter = new MarginBorder($xmlWriter);
134134
$styleWriter->setSizes($style->getBorderSize());
135+
$styleWriter->setStyles($style->getBorderStyle());
135136
$styleWriter->setColors($style->getBorderColor());
136137
$styleWriter->write();
137138

0 commit comments

Comments
 (0)