Skip to content

PHPPresentation setLayoutPack missing documentation #562

@abonne01

Description

@abonne01

Hello,

We were using (in previous version) function setLayoutPack and master slide.
We loaded template, select master slide (with his id) and then layout with name. Maybe not the best way, but it worked.
I tried to migrate code bellow without success on new library version.

way to load template:

$oWriterPPTX = IOFactory::createWriter($_objPHPPowerPoint_, 'PowerPoint2007');
$oWriterPPTX->setLayoutPack(new PhpOffice\PhpPresentation\Writer\PowerPoint2007\LayoutPack\TemplateBased('./template/template.pptx'));

How we assigned slide to it

function createTemplatedSlide($_idTemplate = '2') {
    global $_objPHPPowerPoint_;
    $slide = $_objPHPPowerPoint_->createSlide();
 
    $slide->setSlideMasterId($_idTemplate );
    $slide->setSlideLayout('vide');
    return $slide;
}

I saw that set slideLayout is waiting object PhpPresentation\Slide\SlideLayout.. but I wasn't able to load it from template..

I didn't find examples to perform this action. Could you please help (and update documentation)

Thanks a lot in advance

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions