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

Page breaks on titles and tables #274

Closed
mcbrenly opened this issue Jun 10, 2014 · 4 comments
Closed

Page breaks on titles and tables #274

mcbrenly opened this issue Jun 10, 2014 · 4 comments

Comments

@mcbrenly
Copy link

The page break isn't working before/between titles. It does work here after the title and before the text.

$section->addText('Ut lacinia vehicula odio ac faucibus.');
$section->addPageBreak();
$section->addTitle('First Title');
$section->addPageBreak();
$section->addTitle('Second Title');
$section->addPageBreak();
$section->addText('Ut lacinia vehicula odio ac faucibus.');

The page break also has issues working before/between tables. It works after the second table when the next element is text.

$tableStyle = array('borderSize' => 1);
$width      = 2000;
$cellStyle  = array('borderSize' => 1);

$section->addText('A line before the table');
$section->addPageBreak();

$firstTable = $section->addTable($tableStyle);
$firstTable->addRow()->addCell($width, $cellStyle)->addText('First Table');
for ($i = 0; $i < 5; $i++)
{
    $firstTable->addRow()->addCell($width, $cellStyle)->addText('Cell');
}
$section->addPageBreak();

$secondTable = $section->addTable($tableStyle);
$secondTable->addRow()->addCell($width, $cellStyle)->addText('Second Table');
$section->addPageBreak();

$section->addText('A line after the table');
@ivanlanin
Copy link
Contributor

Thanks for the report. Bug confirmed. Will be looking for solution. This is related to #150.

@ivanlanin ivanlanin added this to the 0.12.0 milestone Jun 10, 2014
@ivanlanin
Copy link
Contributor

Bugfix pushed. Still waiting for Travis, but the bug should be fixed by now. Please run your tests against the latest develop branch (dev-develop on Composer). Thanks.

@ivanlanin ivanlanin self-assigned this Jun 11, 2014
@mcbrenly
Copy link
Author

Tests ran perfectly - thanks for getting it fixed so fast.

@ivanlanin
Copy link
Contributor

You're welcome. Please don't hesitate to report any issues in the future. Your reports help PHPWord to improve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants