Skip to content

Custom Presentation layout #722

@Offbeatmammal

Description

@Offbeatmammal

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions