Please provide macros to insert the current page number and total number of pages

0 votes
asked Nov 1, 2017 in Closed feature request by Steve
If I place a header, or footer in my sequence diagram, and I use newpage to span pages for readability, I don't see a way to place a page number such that it is correct.  If I manually enter the page number in header or footer, only the last one is used for all pages.  Is there a way to enter a page number code in the header or footer such that it is displayed correctly or, barring that, to have a different header and footer per page so I can manually enter the page numbers?

I'd like to have a footer with "Page # of ##" ideally.

1 Answer

0 votes
answered Nov 3, 2017 by plantuml (226,400 points)
 
Best answer

Thanks for the suggestion, this is a good idea!
With last beta (beta16) http://beta.plantuml.net/plantuml.jar

You can now have:
@startuml
footer This is %page% of %lastpage%
Alice --> Bob : A1
newpage
Alice --> Bob : A2
newpage
Alice --> Bob : A3
newpage
Alice --> Bob : A4
@enduml

This has not been widely tested, so do not hesitate to post here if you find issues.
Thanks again!

commented Nov 3, 2017 by Steve
So far, so good.  I'll let you know if I run into problems.
commented Mar 11 by calcium (100 points)
I can confirm that it works in v 2020.2

But if I have

!pragma teoz true

then it is broken. :-(

It comes up as

Page %page% of %lastpage% instead of Page 1 of 1

but only if the

!pragma teoz true

is set
commented Mar 11 by Serge Wenger Work (12,800 points)
Please create a new question. I think it is not done with the new preprocessor
commented Mar 11 by plantuml (226,400 points)
This is (partialy) solved in last beta http://beta.plantuml.net/plantuml.jar

teoz does not handle completely the "newpage" directive.

A new question would be indeed better :-)
...