Skip to content

Notes crash PPTX unless they're on each slide  #83

Open
@JewrassicPark

Description

@JewrassicPark

Basic method is

$pp = new PhpPowerpoint();
//don't put any notes on the first slide 
$slide = $pp->createSlide();
$note = $slide->getNote();
$text = $note->createRichTextShape()->setHeight(300)->setWidth(600);
$text->createTextRun("Any Note");
$oWriterPPTX = IOFactory::createWriter($pp, 'PowerPoint2007');
$oWriterPPTX->save($savePath);      

This causes Office PowerPoint to crash.

It can be worked around by adding a non empty note to every slide.

e.g. this works:

$pp = new PhpPowerpoint();
//putting a note on the first slide
$slide  = $pp->getActiveSlide();
$note = $slide->getNote();
$text = $note->createRichTextShape()->setHeight(300)->setWidth(600);
$text->createTextRun("Any Note");
//putting a note on the second slide 
$slide = $pp->createSlide();
$note = $slide->getNote();
$text = $note->createRichTextShape()->setHeight(300)->setWidth(600);
$text->createTextRun("Any Note");
$oWriterPPTX = IOFactory::createWriter($pp, 'PowerPoint2007');
$oWriterPPTX->save($savePath);      

Notes generated with PHPPowerpoint show up in the pptx zip according to slide

noteSlide2.xml => slide # 2, noteSlideX.xml => slide # x

When created with MS Office, the noteSlides are just numbered sequentially

noteSlide1.xml => corresponds to some slide not necessarily #1 , noteSlide2.xml => same thing

They also have a _rels relationship folder and a noteSlideMaster folder. I couldn't work out the exact mapping or how to avoid this crashing issues. Currently I'm using the workaround.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions