Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The configuration of the Section breakType does not take effect when adding it to a Word2007 format file. #2489

Closed
teair opened this issue Oct 19, 2023 · 0 comments

Comments

@teair
Copy link

teair commented Oct 19, 2023

Describe the Bug

The section break is not taking effect.

Steps to Reproduce

Please provide a code sample that reproduces the issue.

<?php
require __DIR__ . '/vendor/autoload.php';

$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection(['breakType' => 'nextPage']);
$section->addText('Text one');
$section->addText('Text two');

IOFactory::createWriter($phpWord,'Word2007')->save('test.docx');

Expected Behavior

Text two should be on the second page.

Current Behavior

There is no page break separating Text one and Text two, As shown in the image below...

Similarly, for nextColumn...

image

Context

Please fill in your environment information:

  • PHP Version:7.4
  • PHPWord Version:1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant