Pptxgenjs: How to get slide number of the slide created?

Created on 11 Jun 2018  路  7Comments  路  Source: gitbrent/PptxGenJS

There are two ways that we can create a slide.

  1. Manual create.
  2. Insert a table that auto flow if exceed a slide.

How to know the slide number for the 2 cases above?

question

Most helpful comment

Is there a way to do this in v3? It looks like getPageNumber is no long available.

I use this functionality to hot link between slides where I do not know the what the slide number will be in advance of creating in the presentation.

All 7 comments

Hi @okaiyong ,

There is currently no API method to return the slide number for a given slide.

Is there a way to know how many slides generated if the table cannot fit into 1 slide? So in some way we can still compute the slide number programmatically.

Returned slide object of addNewSlide API has getPageNumber() and its public. You can use that to get slide number for manual created one.

Thanks @kumaarraja !

I forgot all about getPageNumber() - it wasn't even in the docs... :-(

It's documented now: Slide Methods: getPageNumber

Is there a way to do this in v3? It looks like getPageNumber is no long available.

I use this functionality to hot link between slides where I do not know the what the slide number will be in advance of creating in the presentation.

Same issue. any plans to add getPageNumber method to v3?

found !!! getPageNumber() is now a property: "number"

Was this page helpful?
0 / 5 - 0 ratings