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

passing fontSize < 8 to slideNumber corrupts presentation #432

Closed
ghost opened this issue Nov 15, 2018 · 2 comments
Closed

passing fontSize < 8 to slideNumber corrupts presentation #432

ghost opened this issue Nov 15, 2018 · 2 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Nov 15, 2018

First off, thank you for building this module. It is quite easy to work with and generate pptx files.

step to reproduce

I noticed passing a fontSize < 8 to slideNumber method will corrupt the powerpoint file:

const PptxGenJS = require('pptxgenjs');
const pptx = new PptxGenJS();
const slide = pptx.addNewSlide();
// specifying fontSize < 8 will corrupt presentation
slide.slideNumber({ x:1.5, y:1.5, fontSize:7.8});
pptx.save('slide number fontSize error');

expected result

As a developer, I would like slideNumber to throw an error when I call that method with an invalid value for fontSize. This would improve my debugging experience.

@gitbrent gitbrent self-assigned this Nov 16, 2018
@gitbrent gitbrent added this to the 2.5.0 milestone Nov 16, 2018
@gitbrent
Copy link
Owner

Hi @efx

It wasn't actually the size, it was the float value. Any fontSize value with a "." was causing the issue.

Thanks for finding this.

Fixed in the master branch.

gitbrent added a commit that referenced this issue Nov 16, 2018
@ghost
Copy link
Author

ghost commented Nov 16, 2018

ah, interesting. thank you for the rapid fix @gitbrent !

ericrockey pushed a commit to WeTransfer/PptxGenJS that referenced this issue Mar 24, 2020
ericrockey pushed a commit to WeTransfer/PptxGenJS that referenced this issue Mar 24, 2020
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

1 participant