Built-in page overlay helpers

Create an overlay function for simple headers and footers.

  • outside_top_text – Text to display on the top outside page corner.

  • centered_top_text – Text to display centered in the top margin

  • outside_bottom_text – Text to display on the bottom outside page corner.

  • centered_bottom_text – Text to display centered in the bottom margin

  • font – Font to use for all text. If none is provided, this will default to a slightly smaller version of the default font.

The outside corner positions vary based on whether the page is left or right sided. The text items are positioned half along the margins. Center text is automatically center-aligned, and outside text is aligned to the outside.

All text items can include a magic template string "%page", which will be automatically replaced by the overlaid page’s number. For instance, simple_header_footer(centered_bottom_text="Page #%page) will generate footers with the text “Page #1”, “Page #2”, etc.

This generates and reutrns a PageOverlayFunc which should be passed to the document’s page generator with:

>>> neoscore.document.pages.overlay_func = simple_header_footer() 

This only affects pages created after set, so typically this should be done right after neoscore.setup().