Forum


Replies: 3   Views: 3762
Section break (odd)
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 seb  · 20-08-2015 - 10:34

Hi, I seem to have real problems breaking from the current page and resuming on the next odd page. I try $docx->addSection('oddPage','A4'); but it has no effect. Even if I try 'evenPage', the resulting document is exactly the same with the same number of pages. How can I make certain that I add a blank page after my content to make sure im starting on the next available odd page? Thanks, Seb

Posted by admin  · 20-08-2015 - 11:57

Hello, Please run this scripts to understand how evenPage and oddPage options work: http://pastebin.com/bMwfpVfR http://pastebin.com/40tm0D84 and open both DOCX. The oddPage adds a section, where you add text, in the next odd page. And the evenPage adds a section in the next even page. But it's very important to understand that you can't know if a content fills a whole page, so you don't know if the next page will be an odd or an even page. Regards.

Posted by seb  · 20-08-2015 - 12:37

Thank you for the examples. I see now that in the 'oddPage' example, there is a hidden page, and when you go to print this document, the hidden page becomes apparent.

Posted by admin  · 20-08-2015 - 16:33

Hello, That's how Word works when you add a new section. You can force new odd and even sections, but each section has its own content. If you open both documents you'll see they only have two pages. Regards.