Adding "Page X of Y" Numbers to PDF Output

In an ODS RTF example, we defined an ODS escape character (ODS ESCAPECHAR=) so that we could code a special sequence to insert page numbers into the document in the form "Page X of Y". This capability is also available when creating PDF output with ODS. The ESCAPECHAR functions to use with ODS PDF output are {thispage} for the "X" position and {lastpage} for the "Y" position. Each ESCAPECHAR function is enclosed in curly braces and preceded by the escape character. In the following code, the ODS escape character is set to the caret (^).

Consider the following set of FOOTNOTE statements:

ODS ESCAPECHAR='^'; ODS PDF FILE="Footnotes.pdf"; footnote justify=left 'Page ^{thispage} of ^{lastpage}'; footnote2 ...

Get Output Delivery System: The Basics and Beyond now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.