PptxGenJS icon indicating copy to clipboard operation
PptxGenJS copied to clipboard

solution for issue #625

Open mikemeerschaert opened this issue 2 years ago • 3 comments

Fixes issue #625 by adding a reference to the newly created slides created by an auto-paged table.

Example usage would look like this:

slide = pptx.addSlide({ sectionTitle: "Tables: Auto-Paging", masterName: "MASTER_AUTO_PAGE_TABLE_PLACEHOLDER" });
slide.addText(
	[
		{ text: "Table Examples: ", options: DEMO_TITLE_TEXT },
		{ text: "Master Page with Auto-Paging", options: DEMO_TITLE_OPTS },
	],
	{ x: 0.5, y: 0.13, w: "90%" }
);
slide.addText("Auto-Paging table", { placeholder: "footer" });
slide.addTable(arrRows, { x: 1.0, y: 0.6, colW: [0.75, 1.75, 7], margin: 0.05, border: { color: "CFCFCF" }, autoPage: true });
//newAutoPagedSlides contains an array of the newly created slides when an auto-paged table is added
//Otherwise it's just an empty array.
slide.newAutoPagedSlides.forEach((slide) => slide.addText("Auto-Paging table continued...", { placeholder: "footer" }));

I also updated EX-3: "Master Page with Auto-Paging" to demonstrate / test the functionality, and created a new master slide that's a copy of MASTER_PLAIN but with a placeholder option in the slide footer.

I'm submitting this because I urgently need this feature to work, the workarounds listed on #625 don't work for my specific use case without a major re-write of a large project, so I'm hoping to get the ball rolling on this. I totally understand if you don't want another property added to slide, so if there is a better solution I'm happy to help implement it to get it done quicker.

Thanks for your consideration!

mikemeerschaert avatar Jul 28 '22 19:07 mikemeerschaert

this last version is v3.10.0,no have newAutoPagedSlides, When will it be released? Where can I understand the release rules?

xingkoo avatar Aug 01 '22 23:08 xingkoo

Thanks @mikemeerschaert

Patches need to be against the code src/*.ts files. Files under dist are generated.

See other recent pull requests for examples.

gitbrent avatar Aug 09 '22 03:08 gitbrent

Sorry about that @gitbrent, I removed the auto-generated files.

mikemeerschaert avatar Aug 09 '22 16:08 mikemeerschaert

Great work, thanks @mikemeerschaert !

gitbrent avatar Feb 08 '23 06:02 gitbrent

@xingkoo in case you didn't see, this was released yesterday with v3.12.0

mikemeerschaert avatar Mar 21 '23 17:03 mikemeerschaert