Add finalizePage hook after page layout is completed
- Adds a
finalizePage
hook that is triggered after page layout is completed, so afterafterPageLayout
to tidy up any changes that occurred in layout or when generated content was added. - Update the margins calculation in
atPage
to run in the new hook.