11 Vote

RTF: Insert Page X of Y into the Footer

Question by Filer | Last update on 2021-07-01 | Created on 2015-08-25

I am trying to create an RTF document manually. What is missing, is some information about page number on each page within the footer of the RTF.

I would like to see something like "Page X of Y" within the footer. But how is it possible to get the information about the current page number and how many pages there are at all in my document? Is there any placeholder or something like that available in the RTF format?

ReplyPositiveNegative
2Best Answer2 Votes

You can get the current page number by using the following control word:

\chpgn

In order to retrieve the number of pages of the entire document, you can use the following:

{\field{\*\fldinst NUMPAGES }}

With combining both methods, your footer definition can look like that:

{\footer\pard\qc page \chpgn of 
{\field{\*\fldinst NUMPAGES }}\par}

This is writing a centered text into your footer, for example "page 1 of 3".
Last update on 2021-07-01 | Created on 2015-08-26

ReplyPositive Negative
Reply

Related Topics

RTF: Center Text in Footer

Question | 1 Answer

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own article on askingbox.com. That’s how it’s done.