Skip to content
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

Feature/slide background #610

Closed

Conversation

thomasowow
Copy link

Fixes #533

Adds the feature to add a background image to a slide which is not a master.

Use:

// The parameter can be exactly the same as one for a [master slide](https://gitbrent.github.io/PptxGenJS/docs/masters.html).
slide.background({
    src: 'some-url',
});

@readeral
Copy link

Hey @gitbrent - any chance this could be reviewed? Would be super handy.

@readeral
Copy link

Given the pull request is against the dist files, rather than the source, this pull request won't be merged. @thomasowow - the project has had a number of changes since this pull request was made, it's not immediately obvious where your code ought to go, but it might be worth opening a new PR?

@gitbrent gitbrent self-assigned this May 26, 2020
@gitbrent gitbrent added this to the 3.3.0 milestone May 26, 2020
@gitbrent
Copy link
Owner

Thanks @thomasowow

Code is too old to merge, so i've added it manually.

Add a background image to any slide now:

slide.background = {
  path: "https://raw.githubusercontent.com/gitbrent/PptxGenJS/master/demos/common/images/starlabs_bkgd.jpg"
}

@gnikolovski
Copy link

@gitbrent I tried testing this (locally build from latest commit 7ae0765) and it's not working.

I tried to add a background image like this:

slide.background = { path: "https://raw.githubusercontent.com/gitbrent/PptxGenJS/master/demos/common/images/starlabs_bkgd.jpg" }

Am I doing something wrong?

@gitbrent
Copy link
Owner

gitbrent commented Jun 5, 2020

@gnikolovski

Make sure your version shows 3.3.0-beta

var pptx = new PptxGenJS();
var slide = pptx.addSlide();

slide.background = {path:'https://raw.githubusercontent.com/gitbrent/PptxGenJS/master/demos/common/images/starlabs_bkgd.jpg'}

slide.addText('background!', { x:1, y:1, w:'80%', h:1, align:'center', fill:pptx.SchemeColor.background2 });

pptx.writeFile('PptxGenJS-Test');

Screen Shot 2020-06-04 at 21 27 25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is it possible to set an image as the background of the slide ?
4 participants