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

Certain options like addTable, addText not working properly inside tableToSlides, happens in demo as well #715

Closed
Smithvinayakiya opened this issue Apr 21, 2020 · 1 comment
Assignees
Milestone

Comments

@Smithvinayakiya
Copy link

Smithvinayakiya commented Apr 21, 2020

Hi @gitbrent

options for addTable, addText in tableToSlides are not working. So one can add a table or text but can't format it.

This is the case even for the demo option Demo table Above (Dynamic text) under the HTML to Powerpoint for which we invoke table2slides2() function.

function table2slides2() {
	// FIRST: Instantiate new PptxGenJS instance
	var pptx = new PptxGenJS();

	// STEP 1: Add Master Slide defs / Set slide size/layout
	addMasterDefs(pptx);
	pptx.layout = "LAYOUT_WIDE";

	// STEP 2: Set generated Slide options
	var objOpts = {};
	//objOpts.verbose = true;
	if ($("input[name=radioHead]:checked").val() == "Y") objOpts.addHeaderToEach = true;
	if ($("#checkStartY")) objOpts.newSlideStartY = Number($("#numTab2SlideStartY").val());
	if ($("#selSlideMaster").val()) objOpts.masterSlideName = $("#selSlideMaster").val();

	// STEP 3: Add a custom shape (text in this case) to each Slide
	// EXAMPLE: Add any dynamic content to each generated Slide
	// DESC: Add something you cant predefine in a master - like a username/timestamp for each slide, etc.
	// NOTE: You can do this for all other types as well: .addShape(), .addTable() and .addImage()
	objOpts.addText = { text: "(dynamic content - ex:user/datestamp)", options: { x: 1.1, y: 0.6, color: "0088CC", fontFace: "Arial", fontSize: 12 } };

	// STEP 4: Pass table to tableToSlides function to produce 1-N slides
	pptx.tableToSlides("tabAutoPaging", objOpts);

	// LAST: Export Presentation
	pptx.writeFile("Table2Slides-with-dynamic-text");
}

The options in objOpts.addText not working. Same is the case with addTable, the content appears but without the options being applied.

@Smithvinayakiya Smithvinayakiya changed the title options not working inside tableToSlides Certain options like addTable, addText not working properly inside tableToSlides Apr 22, 2020
@Smithvinayakiya Smithvinayakiya changed the title Certain options like addTable, addText not working properly inside tableToSlides Certain options like addTable, addText not working properly inside tableToSlides, happens in demo as well Apr 24, 2020
@gitbrent gitbrent self-assigned this May 24, 2020
@gitbrent gitbrent modified the milestones: 3.3.0, 3.2.1 May 24, 2020
@gitbrent
Copy link
Owner

@Smithvinayakiya - thanks!

This has been broken since 3.0.0 :(

Fixed in master branch:
Screen Shot 2020-05-24 at 00 14 04

gitbrent added a commit that referenced this issue May 24, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants