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.
I am using addSection to cause a page break to an odd numbered page. This is useful when starting a new chapter of a book. $docx->addSection('oddPage', 'A4',$layout); In this case the new section does start on an odd page so this portion is working.
We're having problems using addSection in that a blank page is not created as a result of the page break. The Introduction begins on page 3. Then we issue an addSection for the first chapter. This results in the first chapter starting on page 5 -- all good. The problem is the resulting document does not contain a page 4 -- it skips directly from page 3 to page 5.
I hope we will be able to use addSection instead of keeping track of the page numbering in php.
Hello,
Please try adding a page break using this method:
http://www.phpdocx.com/api-documentation/word-content/insert-line-column-page-break-Word-document-with-PHP
before or after you add a new section.
Regards.
Hi There,
Thank you for your feedback on this topic. I tried what you suggested but we did not obtain the desired result.
$docx->addBreak(array('type' => 'page'));
The line above will add a page break to the document. It does this without regard to if the break will take the document to an Odd or Even page. This is the purpose of a section break with Even or Odd specified as you can see here:
https://support.office.microsoft.com/en-us/article/Insert-a-section-break-eef20fd8-e38c-4ba6-a027-e503bdf8375c?CorrelationId=d3db5959-5b95-4479-b865-878c6de3fe3c&ui=en-US&rs=en-US&ad=US
Do you have the ability to recreate the problem? Greg
Hello, Please send us a document with the result of what you are expecting to generate with phpdocx, in order to trying to replicate it with the library. You may send it to contact@phpdocx.com
Regards
I just sent a recreate script as requested. Greg