Skip to content
New issue

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

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

Already on GitHub? # to your account

Bug #71

Closed
alexbai31 opened this issue Apr 6, 2017 · 4 comments
Closed

Bug #71

alexbai31 opened this issue Apr 6, 2017 · 4 comments
Assignees

Comments

@alexbai31
Copy link

Hi there, we've faced with the following bug:
when sending the array with objects as the first parameter, where each object involves "text" and "options" attributes and herewith to the "options" attribute is assigned the object, which includes "bullet" parameter with any value, then after the .pptx is generated we get an error on opening the file.

Привет! Столкнулись со следующим багом:
в методе addText если первым аргументом посылать массив с объектами где каждый объект включает в себя атрибуты "text" и "options" и к атрибуту options присвоен объект включающий в себя параметр "bullet" с любим значением, после того как .pptx будет сгенерирован возникает ошибка при открытии файла.

@gitbrent gitbrent self-assigned this Apr 6, 2017
@gitbrent
Copy link
Owner

gitbrent commented Apr 6, 2017

Hi @alexbai31 ,

What version of PowerPoint are you using, and can i see the code?

@alexbai31
Copy link
Author

PowerPoint 2010

The part of code, which is required:

var textOptions = { font_size: 9, font_face: 'Calibri', color: '000', align: 'l', bullet: true };
var pptx = new PptxGenJS();
pptx.setLayout('LAYOUT_16x10');
var slide = pptx.addNewSlide();
slide.addText(
[
{ text: ltxt, options: textOptions }
],
{ x: 0, y: 0, w: 5, h: 2, margin: 0.1, fill: 'ffffff' }
);

There are several strings of the text divided with '\n' symbol in "ltxt"

@ZouhaierSebri
Copy link

ZouhaierSebri commented Apr 6, 2017

It is the same as issue #64

change in pptxgen.js is required add check idx === 0 to add body part one time

// B: Add bodyProp
if ( idx === 0 ) {
strSlideXml += genXmlBodyProperties(textObj.options) + '<a:lstStyle/>';
}

gitbrent pushed a commit that referenced this issue Apr 6, 2017
@gitbrent
Copy link
Owner

gitbrent commented Apr 6, 2017

Hi @alexbai31 ,

Thanks for reporting this. The issue should be fixed in the latest codebase.

Please try again and let me know how it goes.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants