Skip to main content
Participant
Dec 12, 2023 10:37 PM UTC
Answered

How to add both book current page / total pages AND the file current page / total pages to header

I have a situation where I need to show two sets of page numbers in the header of some of the files in my book. I need to show the book's current page and total pages. That is pretty straigtforward. I also, in the same header, need to show this .fm file's current page and total pages.  For example:

Page 13 of 43

Attahment 1

Page 1 of 3

 

Any suggestions? Thanks!

    This topic is closed to new replies. Start a new post to keep the conversation going.
    frameexpert
    frameexpertCorrect answer
    Community Expert
    Dec 14, 2023 10:18 PM UTC

    Here is a 6 and a half minute video that shows a scripting solution to this poster's request:

    https://youtu.be/h7lYpT54PSA

    www.frameexpert.com

    5 replies

    frameexpert
    Community Expert
    frameexpertCommunity ExpertCorrect answer
    Community Expert
    Dec 14, 2023 10:18 PM UTC

    Here is a 6 and a half minute video that shows a scripting solution to this poster's request:

    https://youtu.be/h7lYpT54PSA

    Translate
    www.frameexpert.com
    Community Expert
    Dec 13, 2023 1:09 PM UTC

    Hi,

    The current page of the book is <$curpagenum>.

    The last page of the book is <$totalpagesinabook>.

    Only the current and last page of the current files are difficult to get. You want that the page numbering starts with the firt page of the file. As you set the page numbering in the numbering settings of your file only (probably continue page numbering from previous file), you cannot set another page numbering scheme.

    Then you can use a hack like that which Bob described. For the numbering of the last page you might insert a cross-reference to the numbered paragraph on the last last page. It could be that you have to update this cross-reference manually, when the number of pages changes, so that the cross-reference always links to the paragraph on the last page.

    Of course you can automate everything with ExtendScript.

    Best regards, Winfried

    Translate
    frameexpert
    Community Expert
    Community Expert
    Dec 13, 2023 1:59 PM UTC

    The <$lastpagenum> building block is the last page of the current document. So the only one you need is the current page number in the context of the entire book. If I were to script this, I would use calculate the starting page number of each component in context of the entire book. Then, for each document, I would use a Running H/F marker on each page to indicate it's page number in the context of the book. The script could be run automatically whenever you update the book.

    Translate
    www.frameexpert.com
    Community Expert
    Dec 13, 2023 2:13 PM UTC

    Unfortunately <$lastpagenum> is the last page number of the file in the book and not the total number of pages of the file.

    Therefore you still need a solution for the last page number of the current file.

    Translate
    Bob_Niland
    Community Expert
    Community Expert
    Dec 12, 2023 10:50 PM UTC

    As a quick hack, I might do this as some hidden text on each page that sports an autonumbered para; one instance per page. The trick is how to anchor it so that you get one, and only one, per page. The RHFs could then pick that up.

    And if I did it this way, I'd be tempted to add a small Flow P text frame to the Master Pages. The frame only needs to be one line high, and contain only the AN para, in some color turned off for publication via Color Views. Just make sure that the frame isn't empty on any pages.

    Translate