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

pageSizeW & pageSizeH no longer works? #336

Closed
davidbwachs opened this issue Aug 16, 2014 · 4 comments
Closed

pageSizeW & pageSizeH no longer works? #336

davidbwachs opened this issue Aug 16, 2014 · 4 comments
Assignees
Milestone

Comments

@davidbwachs
Copy link

Hello,
I have custom sized paper I need to dynamically create in PHP and while this worked in the old .6 version, it no longer works with the github version. Am I doing something wrong?

$twips = 1440;
$width = $width * $twips;
$height = $height * $twips;
$marginTop = $marginTop * $twips;
$marginLeft = $marginLeft * $twips;
$marginRight = $marginRight * $twips;
$marginBottom = $marginBottom * $twips;

// New Word Document
$PHPWord = new \PhpOffice\PhpWord\PhpWord();

// New portrait section
$section = $PHPWord->addSection(array(
    'pageSizeW'     => $width,
    'pageSizeH'     => $height,
    'marginTop'     => $marginTop,
    'marginRight'   => $marginRight,
    'marginLeft'    => $marginLeft,
    'marginBottom'  => $marginBottom));

The page size always is now coming out as A4 even though I am trying my own custom sizes. Any help would be appreciated.

Thanks,
David

@davidbwachs
Copy link
Author

Hi, can anybody confirm if this is a problem?

@EricSarmany
Copy link

I am having this same problem.

@spikex
Copy link
Contributor

spikex commented Sep 22, 2014

Yes, I can confirm. The issue is that vendor/phpoffice/phpword/src/PhpWord/Style/Section.php is missing setters for pageSizeW and pageSizeH.

@Progi1984
Copy link
Member

This issue has been corrected by @spikex in the develop branch.

@Progi1984 Progi1984 self-assigned this Oct 3, 2014
@Progi1984 Progi1984 added this to the 0.12.0 milestone Oct 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants