Skip to content

Commit e97f35b

Browse files
authored
Update Section.php - Add Vertical Align
1 parent 193e3b2 commit e97f35b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/PhpWord/Writer/RTF/Style/Section.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ public function write()
5555
$content .= $this->getValueIf($style->getFooterHeight() !== null, '\footery' . round($style->getFooterHeight()));
5656
$content .= $this->getValueIf($style->getGutter() !== null, '\guttersxn' . round($style->getGutter()));
5757
$content .= $this->getValueIf($style->getPageNumberingStart() !== null, '\pgnstarts' . $style->getPageNumberingStart() . '\pgnrestart');
58+
59+
// Vertical Align
60+
$verticalAlign = [
61+
\PhpOffice\PhpWord\SimpleType\VerticalJc::TOP => '\vertalt',
62+
\PhpOffice\PhpWord\SimpleType\VerticalJc::CENTER => '\vertalc',
63+
\PhpOffice\PhpWord\SimpleType\VerticalJc::BOTH => '\vertalj',
64+
\PhpOffice\PhpWord\SimpleType\VerticalJc::BOTTOM => '\vertalb',
65+
];
66+
if (isset($verticalAlign[$style->getVAlign()])) { $content .= $verticalAlign[$style->getVAlign()]; }
5867
$content .= ' ';
5968

6069
// Borders

0 commit comments

Comments
 (0)