Replies: 2   Views: 468
Addtext option 'pagebreakbefore'
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by phosira  · 17-11-2022 - 09:53


when i use addText option 'pageBreakBefore' and create document,

it's not edtable and make dot front of sentence.

how can i use addText option 'pageBreakBefore' with editable and no dot front of sentece?

Posted by admin  · 17-11-2022 - 15:30


The pageBreakBefore option available in addText is a paragraph style:

$docx = new CreateDocx();
$docx->addText('New content', array('pageBreakBefore' => true));

This pageBreakBefore option enables the "Page break before" option available for paragraphs in DOCX documents. It can be edited/changed/updated using MS Word and any other DOCX program. For example using MS Word: right click on the paragraph => "Line and Page Breaks" tab => "Page break before" option. The option is working as expected.

You can also add page breaks using addBreak:

$docx->addBreak(array('type' => 'page'));
$docx->addText('New content');

working with the document and with WordFragments. Or add new sections with addSection to create new pages.


Posted by phosira  · 18-11-2022 - 02:02

Thaks addBreak is what im looking for.

I soved it.