Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/changes/1.x/1.5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Bug fixes

- Set writeAttribute return type by [@radarhere](https://github.com/radarhere) fixing [#2204](https://github.com/PHPOffice/PHPWord/issues/2204) in [#2776](https://github.com/PHPOffice/PHPWord/pull/2776)
- Writer RTF: Support for verticalAlign in Section by [@rasamassen](https://github.com/rasamassen) in [#2817](https://github.com/PHPOffice/PHPWord/pull/2817)

### Miscellaneous

Expand All @@ -16,4 +17,4 @@

### BC Breaks

### Notes
### Notes
11 changes: 11 additions & 0 deletions src/PhpWord/Writer/RTF/Style/Section.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ public function write()
$content .= $this->getValueIf($style->getFooterHeight() !== null, '\footery' . round($style->getFooterHeight()));
$content .= $this->getValueIf($style->getGutter() !== null, '\guttersxn' . round($style->getGutter()));
$content .= $this->getValueIf($style->getPageNumberingStart() !== null, '\pgnstarts' . $style->getPageNumberingStart() . '\pgnrestart');

// Vertical Align
$verticalAlign = [
\PhpOffice\PhpWord\SimpleType\VerticalJc::TOP => '\vertalt',
\PhpOffice\PhpWord\SimpleType\VerticalJc::CENTER => '\vertalc',
\PhpOffice\PhpWord\SimpleType\VerticalJc::BOTH => '\vertalj',
\PhpOffice\PhpWord\SimpleType\VerticalJc::BOTTOM => '\vertalb',
];
if (isset($verticalAlign[$style->getVAlign()])) {
$content .= $verticalAlign[$style->getVAlign()];
}
$content .= ' ';

// Borders
Expand Down