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

Custom Presentation layout #722

Closed
Offbeatmammal opened this issue Oct 20, 2022 · 1 comment · Fixed by #811
Closed

Custom Presentation layout #722

Offbeatmammal opened this issue Oct 20, 2022 · 1 comment · Fixed by #811

Comments

@Offbeatmammal
Copy link

I'm trying to set a widescreen, 13.333" x 7.5" size for my PowerPoint document.
fFom the samples (and what I can understand from the source) this should work

$objPHPPowerPoint = new PhpPresentation();
$objPHPPowerPoint->getLayout()->setDocumentLayout(DocumentLayout::LAYOUT_CUSTOM)
                            ->setCX(13.333,DocumentLayout::UNIT_INCH)
                            ->setCY(7.5,DocumentLayout::UNIT_INCH); 

but I get the following error

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in 
C:\...d\vendor\phpoffice\phppresentation\src\PhpPresentation\DocumentLayout.php:138
Stack trace:
#0 C:\...\pptx.php(30): PhpOffice\PhpPresentation\DocumentLayout->setDocumentLayout('custom')
#1 {main}
  thrown in C:\...d\vendor\phpoffice\phppresentation\src\PhpPresentation\DocumentLayout.php on line 138

Using LAYOUT_SCREEN_16X9 and LAYOUT_OVERHEAD don't throw an error in generation, but PowerPoint repairs the file on opening

@Progi1984
Copy link
Member

Fixed in #811 by @jiangzhangchan

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