Skip to content

Commit 7d17cb3

Browse files
authored
verticalAlign in Section.php
Adds missing verticalAlign settings.
1 parent 0ab0b49 commit 7d17cb3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ 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()])) {
67+
$content .= $verticalAlign[$style->getVAlign()];
68+
}
5869
$content .= ' ';
5970

6071
// Borders

0 commit comments

Comments
 (0)