PHPOffice / PHPPresentation

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

Inserting variables #563

Open toscan opened 4 years ago

toscan commented 4 years ago

Hey,

Is it possible to insert variable into an existing pptx file and insert some images into existing slides ?

abonne01 commented 4 years ago

Hello,

Yes, you can add Images. This is an example used:

$currentSlide= $_objPHPPowerPoint_->createSlide();
$shape = $currentSlide->createDrawingShape();
$shape->setResizeProportional(false);
$shape->setName('Graph')
                ->setPath($_path)
                ->setwidth($size['width'])
                ->setheight($size['height'])
                ->setOffsetX($size['left'])
                ->setOffsetY($size['top']);
toscan commented 4 years ago

Ok, thanks a lot. And what about the variables ? Is possible to merge variables into an existing doc like : https://github.com/mbence/OpenTBSBundle $TBS->MergeField('client', array('name' => 'Ford Prefect'));

abonne01 commented 4 years ago

I personally don't use functionality and have no idea about it..