Forum


Replies: 2   Views: 667
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

Hi,

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

Hello,

The pageBreakBefore option available in addText is a paragraph style:

$docx = new CreateDocx();
$docx->addText('Content');
$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->addText('Content');
$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.

Regards.

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

Thaks addBreak is what im looking for.

I soved it.