Skip to main content
Participant
February 3, 2023
Question

Providing Absolute Page Number and Sectional Page Number on the same page.

  • February 3, 2023
  • 3 replies
  • 235 views

My InDesign Document is broken up into different sections and the pages in each section are numbered per section: Pages in Section A are A.01, A.02, etc. Pages in Section B are B.01, B.02, etc. However, I also want to provide an Absolute Page Number on the bottom right of each page that shows its location in the full document (pg. 02, pg. 03, pg. 04, etc.)

 

How can I add these absolute page numbers so I don't have to do so individually for each page in the file?

This topic has been closed for replies.

3 replies

Peter Kahrel
Community Expert
Community Expert
February 3, 2023

Peter S beat me to it! However, shouldn't those frames be threaded for the numbers to display correctly?

Peter Spier
Community Expert
Community Expert
February 3, 2023

Yes, the frames do need to be threaded, and no, I don't think you can do a padded number, as such, but you can create pretty much any other sort of prefix as fart of the list definition.

Peter Kahrel
Community Expert
Community Expert
February 3, 2023

You can't do that in InDesign: references to page numbers, using cross-references or variables, are always to folios (or displayed page numbers). But it's fairly easy to set up for a script.

 

First, add a text frame for the abslute page numbers to the master pages and name it 'abs page num' on the Layers panel:

 

 

 Then run this script:

(function () {
  
  var pp;
  var frame;

  function overrideAbsoluteFrame (page) {
    var f = page.textFrames.item ('abs page num');
    if (!f.isValid) {
      var m = page.masterPageItems;
      for (var i = 0; i < m.length; i++) {
        if (m[i].name === 'abs page num') {
          f = m[i].override (page);
        }
      }
    }
    return f;
  }


  function pad (n) {
    if (n < 10) {
      return '0'+n;
    }
    return String(n);
  }


  pp = app.documents[0].pages.everyItem().getElements();
  for (var i = 0; i < pp.length; i++) {
    frame = overrideAbsoluteFrame (pp[i]);
    frame.contents = pad (pp[i].documentOffset+1);
  }

}());

 

If pages are added or deleted, simply run the script again.

 

P.

Peter Spier
Community Expert
Community Expert
February 3, 2023

One method would be to add a text frame to the Parent/Master pages with a space in it and define the paragraph as a numbered list.