Skip to content

Conversation

mikemeerschaert
Copy link
Contributor

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 mikemeerschaert mentioned this pull request Aug 1, 2022
4 tasks
@xingkoo
Copy link

xingkoo commented Aug 1, 2022

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

@gitbrent
Copy link
Owner

gitbrent commented Aug 9, 2022

Thanks @mikemeerschaert

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

See other recent pull requests for examples.

@mikemeerschaert
Copy link
Contributor Author

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

@gitbrent gitbrent self-assigned this Aug 14, 2022
@gitbrent gitbrent added this to the 3.12.0 milestone Aug 14, 2022
@gitbrent gitbrent linked an issue Feb 8, 2023 that may be closed by this pull request
@gitbrent gitbrent merged commit 630b1f5 into gitbrent:master Feb 8, 2023
gitbrent added a commit that referenced this pull request Feb 8, 2023
@gitbrent
Copy link
Owner

gitbrent commented Feb 8, 2023

Great work, thanks @mikemeerschaert !

@mikemeerschaert mikemeerschaert deleted the add-reference-to-new-slides-created-by-table-auto-paging branch February 8, 2023 15:12
@mikemeerschaert
Copy link
Contributor Author

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

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

Successfully merging this pull request may close these issues.

How to fill out placeholder on slide generated from autoPage
3 participants