Skip to content

Commit 586f45e

Browse files
authored
Merge pull request #1493 from Patrick64/develop
RTF writer: Round getPageSizeW and getPageSizeH to avoid decimals
2 parents 1a03a6c + 718f84c commit 586f45e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ v0.16.0 (xx xxx 2018)
1010
### Fixed
1111
- Fix regex in `cloneBlock` function @nicoder #1269
1212
- HTML Title Writer loses text when Title contains a TextRun instead a string. @begnini #1436
13+
- RTF writer: Round getPageSizeW and getPageSizeH to avoid decimals @Patrick64 #1493
1314

1415
v0.15.0 (14 Jul 2018)
1516
----------------------

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public function write()
4343
$content .= '\sectd ';
4444

4545
// Size & margin
46-
$content .= $this->getValueIf($style->getPageSizeW() !== null, '\pgwsxn' . $style->getPageSizeW());
47-
$content .= $this->getValueIf($style->getPageSizeH() !== null, '\pghsxn' . $style->getPageSizeH());
46+
$content .= $this->getValueIf($style->getPageSizeW() !== null, '\pgwsxn' . round($style->getPageSizeW()));
47+
$content .= $this->getValueIf($style->getPageSizeH() !== null, '\pghsxn' . round($style->getPageSizeH()));
4848
$content .= ' ';
4949
$content .= $this->getValueIf($style->getMarginTop() !== null, '\margtsxn' . $style->getMarginTop());
5050
$content .= $this->getValueIf($style->getMarginRight() !== null, '\margrsxn' . $style->getMarginRight());

0 commit comments

Comments
 (0)