Skip to content

Add drawings and background images to slide layouts #578

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 18, 2020

Conversation

Brenneisen
Copy link
Contributor

This pull request adds drawings and background images to slide layouts.

@Brenneisen Brenneisen force-pushed the slide-layouts branch 3 times, most recently from 798e124 to d5552b0 Compare June 16, 2020 11:53
@Brenneisen Brenneisen marked this pull request as draft June 16, 2020 12:37
@Brenneisen Brenneisen marked this pull request as ready for review June 16, 2020 12:37
@auto-assign auto-assign bot requested a review from Progi1984 June 16, 2020 12:38
@Progi1984
Copy link
Member

@Brenneisen Have you got a scenario for testing ? A Before/After ?

@Brenneisen
Copy link
Contributor Author

Brenneisen commented Jun 18, 2020

Hi @Progi1984,

here is a simple scenario:

$presentation = new PhpPresentation;
$slideMaster = $presentation->getAllMasterSlides()[0];
$slideLayout = $slideMaster->getAllSlideLayouts()[0];

//Background Image
$background = new Image;
$background->setPath('./background.jpg');
$slideLayout->setBackground($background);

// Image
$shape = $slideLayout->createDrawingShape();
$shape->setPath('./logo.jpg');
$shape->setResizeProportional(true);
$shape->setWidth(130);
$shape->setOffsetX(25);
$shape->setOffsetY(670);

$writer = IOFactory::createWriter($presentation, 'PowerPoint2007');
$writer->save('./presentation.pptx');

The images are not displayed on the slide layout:

This pull request adds drawings and background images to the slide layouts.

@Progi1984 Progi1984 merged commit a352768 into PHPOffice:develop Jun 18, 2020
@Brenneisen Brenneisen deleted the slide-layouts branch June 19, 2020 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants