Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
dhardy1988 opened this issue Oct 2, 2024 · 0 comments
Open

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

dhardy1988 opened this issue Oct 2, 2024 · 0 comments

Comments

@dhardy1988
Copy link

dhardy1988 commented Oct 2, 2024

$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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

1 participant