From 1e85a896e564d6bb19fb642a27a706b02a39e84d Mon Sep 17 00:00:00 2001 From: stanolacko Date: Sat, 17 Feb 2024 22:33:05 +0100 Subject: [PATCH 1/2] page break support --- src/PhpWord/Reader/Word2007/AbstractPart.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PhpWord/Reader/Word2007/AbstractPart.php b/src/PhpWord/Reader/Word2007/AbstractPart.php index 95799387ed..d6d25cf4b8 100644 --- a/src/PhpWord/Reader/Word2007/AbstractPart.php +++ b/src/PhpWord/Reader/Word2007/AbstractPart.php @@ -199,6 +199,9 @@ protected function readParagraph(XMLReader $xmlReader, DOMElement $domNode, $par $fontStyle = $this->readFontStyle($xmlReader, $domNode); $nodes = $xmlReader->getElements('w:r', $domNode); foreach ($nodes as $node) { + if ($xmlReader->elementExists('w:lastRenderedPageBreak',$node)) { + $parent->addPageBreak(); + } $instrText = $xmlReader->getValue('w:instrText', $node); if ($xmlReader->elementExists('w:fldChar', $node)) { $fldCharType = $xmlReader->getAttribute('w:fldCharType', $node, 'w:fldChar'); From b0dc3e33394d1739fac314823ec8cd9e1a6401c5 Mon Sep 17 00:00:00 2001 From: stanolacko Date: Mon, 19 Feb 2024 09:45:40 +0100 Subject: [PATCH 2/2] Update src/PhpWord/Reader/Word2007/AbstractPart.php Co-authored-by: Progi1984 --- src/PhpWord/Reader/Word2007/AbstractPart.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpWord/Reader/Word2007/AbstractPart.php b/src/PhpWord/Reader/Word2007/AbstractPart.php index d6d25cf4b8..67c98d54c1 100644 --- a/src/PhpWord/Reader/Word2007/AbstractPart.php +++ b/src/PhpWord/Reader/Word2007/AbstractPart.php @@ -199,7 +199,7 @@ protected function readParagraph(XMLReader $xmlReader, DOMElement $domNode, $par $fontStyle = $this->readFontStyle($xmlReader, $domNode); $nodes = $xmlReader->getElements('w:r', $domNode); foreach ($nodes as $node) { - if ($xmlReader->elementExists('w:lastRenderedPageBreak',$node)) { + if ($xmlReader->elementExists('w:lastRenderedPageBreak', $node)) { $parent->addPageBreak(); } $instrText = $xmlReader->getValue('w:instrText', $node);