I’m glad it helps.
I hope you don’t get the second problem with PDF generation: by adding many pages, you may end up hitting the 30 second timeout. Even when the PDF is generated by a background task, which itself has no time limit, the PDF generator call still has the 30 second limit, which makes it impossible to generate large PDF files.
Unlike the page footers, this time limit is managed by Anvil. There are good reasons for having it, but that one could be changed.