Skip to content

Table styles are lost when you copy from an existing slide #823

Open
@dhardy1988

Description

@dhardy1988
$slideMap = [];
$slides = $this->objPHPPresentation->getAllSlides();
foreach ($slides as $slide) {
for ($i = 0; $i < 2; $i++) {
    $clonedSlide = $slide->copy();
    $slideMap[] = $clonedSlide;
  }
}

 for ($i = count($slides) - 1; $i >= 0; $i--) {
    $this->objPHPPresentation->removeSlideByIndex($i);
 }

 foreach($slideMap as $slide) {
    $this->objPHPPresentation->addSlide($slide);
 }

I am just cloning a slide, adding it to the slideMap so I can add re-add them after, removing all the slides from phppresentation object to start fresh then looping through and adding them all, the table styles go from a fill colour to all black?

pp-test-report-valid.pptx

Just to update, even this does not work

$slide = $this->objPHPPresentation->getSlide();
        $clonedSlide = $slide->copy();
        $this->objPHPPresentation->addSlide($clonedSlide);

Table ends up black

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions