PHPPresentation icon indicating copy to clipboard operation
PHPPresentation copied to clipboard

Reading and writing PPTX leads to "destroyed" layout

Open deeskayp opened this issue 1 year ago • 1 comments

Hey folks. I'm trying to open a .pptx template file, add my data and write it back as .pptx. However, if I just open the file and write it back, the layout is somehow destroyed.

Here's my code:

$reader = IOFactory::createReader('PowerPoint2007');
$presentation = $reader->load('template.pptx');
$writer = IOFactory::createWriter($presentation, 'PowerPoint2007');
$writer->save('result.pptx');

This is how the template looks like: template

and this is the result: result

I attached my template file: template.pptx

This issue might be related to #718

deeskayp avatar Dec 20 '24 15:12 deeskayp

I'm having exactly the same issue, overall, the saving process seems a bit broken. Displays vertical text instead of horizontal text, wrong font size, shapes aren't saved, image sizes aren't the same, audio/video isn't saved, etc. Unfortunantely this makes the library unusable if you are using slides from another pptx and you're not building the entire pptx from code.

image image image image image image

xlar8or avatar Jan 03 '25 10:01 xlar8or