Datamapper Extract field for number of pages in record (PDF)

Hi there

Is there a way to have an extract field in Datamapper that returns how many pages are in each record? I mean it shows the actual pages in the PDF viewer, so why not the page count?

To get the number of pages in the current record in a PDF based data mapping configuration:

  • Add an Extract Field based on Javascript
  • Use the folloing expression: steps.totalPages;

More information about the steps object is available here:

PReS Connect 1.6.1 User Guide?

Perfect. Thank you Rod

Hi,
I got a follow up question regarding this. This is actually good info, but would like to know if possible to also return the current index page number within the PDF data?

For example

If Record 1 starts at Page 1 and has 4 pages it will have page index of 1.
Record 2 will have current page index of 5 then if it has 3 pages.
Record 3 will have current page index of 8. and so forth.

Thank you in advance.
Kind regards,
E