• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

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

New Here ,
Dec 12, 2023 Dec 12, 2023

Copy link to clipboard

Copied

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!

Views

134

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 14, 2023 Dec 14, 2023

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

https://youtu.be/h7lYpT54PSA

Votes

Translate

Translate
Community Expert ,
Dec 12, 2023 Dec 12, 2023

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 13, 2023 Dec 13, 2023

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 13, 2023 Dec 13, 2023

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 13, 2023 Dec 13, 2023

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 14, 2023 Dec 14, 2023

Copy link to clipboard

Copied

LATEST

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

https://youtu.be/h7lYpT54PSA

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines