Search code examples
phpphpofficephppresentation

PHPOffice PHPPresentation lose original styling on saving pptx


I have simple code that:

  1. Load template pptx (*)
  2. Duplicate few slides
  3. Hydrate those slides with values (just replacing place-holder texts)
  4. Save result to new file

Unfortunately PHPOffice's PHPPresentation is unable to retain slide styling present in template.

Slides saved in step 4. are all white (default styling).

Is there a way to explicitly copy that styling? Is it PHPPresentation limitation 'cause it's unable to read styling or something?

(*) Described issue persist for ppt/odp too. No styling is retained.


Solution

  • The bug is that PHPPresentation (oldly PHPPowerPoint) can't load Slide Layout and Slide Master.

    This bug has an opened issue : https://github.com/PHPOffice/PHPPresentation/issues/161.