PHPOffice / PHPPresentation

A pure PHP library for reading and writing presentations documents
https://phpoffice.github.io/PHPPresentation
Other
1.31k stars 523 forks source link

createDrawingShape stopped working in 1.1.0 #820

Open sinnbeck opened 2 months ago

sinnbeck commented 2 months ago

I am adding images to a powerpoint and it was working fine in v1.0.

This is the code

foreach ($images as $imagePath) {
    $slide = $presentation->createSlide();
    $shape = $slide->createDrawingShape();
    $shape->setPath($imagePath);
    $shape->setResizeProportional(true);
    $shape->setWidth($width);
    $shape->setOffsetX(0);
    $shape->setOffsetY(0);
    $shape->setName('Content');
    $shape->setDescription('Content');
}

Now after updating I just get an empty page with "Content" image

It works if I use this, but I want to add them as drawing shapes

$image = new Image();
$image->setPath($imagePath);
$slide->setBackground($image);
omarjavierr277 commented 1 month ago

I am adding images to a powerpoint and it was working fine in v1.0.

Captura de pantalla 2024-09-25 a la(s) 4 33 47 p  m

code

$imageFile = new File();
$imageFile->setPath($filePath)->setName(time());
$this->activeSlide->addShape($imageFile);
eandradesimbi commented 1 week ago

I'm having the same issue… has anyone found a solution?

andy96453 commented 2 days ago

Same problem, I am creating a powerpoint file with an image on each slide all was working corectly, when upgraded to 1.1 only a few slides had images the rest were broken when writing out to PowerPoint2007