How to remove section pagebreak in PHPWord

不想你离开。 提交于 2019-12-10 10:39:40

问题


I am using PHPWord to create report. When I am creating a section it automatically adding a page break which I donot want.

Is there any way to remove the added page break?

or Is there any way to createSection without the page break?

Please note that I am not using any template. Just creating a doc file from database with tables and images.

Thanks.


回答1:


You can define how the page breaks behave with the section breakType style. To remove the page breaks completely from the sections just use the 'continuous' value for the breakType:

$section = $phpWord->addSection(array('breakType' => 'continuous');

or

$section = $phpWord->addSection();
$section->getStyle()->setBreakType('continuous');

for more info check phpword styles and phpword containers



来源:https://stackoverflow.com/questions/28554893/how-to-remove-section-pagebreak-in-phpword

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!