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

callback support for save method #40

Closed
ellisgl opened this issue Feb 14, 2017 · 5 comments
Closed

callback support for save method #40

ellisgl opened this issue Feb 14, 2017 · 5 comments
Assignees
Milestone

Comments

@ellisgl
Copy link
Contributor

ellisgl commented Feb 14, 2017

I was noticing that I was sending the file before it was update and would like to have a callback fired after the file is written.

@ellisgl
Copy link
Contributor Author

ellisgl commented Feb 14, 2017

#41

@gitbrent gitbrent added this to the v1.2.0 milestone Feb 14, 2017
@gitbrent gitbrent self-assigned this Feb 14, 2017
gitbrent pushed a commit that referenced this issue Feb 16, 2017
Added the filename as return value
@gitbrent
Copy link
Owner

Hi @ellisgl ,

Thanks for opening an Issue and supplying the code!

Change has been implemented (I've added the filename as a return value to the callback function) and the nodejs-demo.js file has been updated with examples.

@Slidemagic
Copy link

Slidemagic commented May 17, 2019

My presentations have a lot of images, so I use plenty of async/awaits while generating a PPTX, the save "filename" callback fires too early in my case. I saw that a Promise for save is coming in 3.0 https://github.com/gitbrent/PptxGenJS/blob/master/CHANGELOG.md, is there already a quick fix I can apply to the code while waiting for the full release?

@Slidemagic
Copy link

Slidemagic commented Nov 20, 2019

My temporary fix for the saveCallback firing too early for whatever reason in Electron is saving as a node buffer, then saving the buffer as a '.pptx' in my own app.
pptx.save(fileNameNotUsed, buffer => { fs.writeFileSync(fileName + '.pptx', buffer) }, 'nodebuffer')

@gitbrent
Copy link
Owner

Version 3.0 will be released very soon and returns a Promise with every save method.

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

No branches or pull requests

3 participants