Header and footer for templates

Header and footer for templates

When invoices require more than page, a header and a footer are compulsory and it's not easy to do with Zoho Templates customization
We can find some solutions in Solution for setting up header and footer in a template , but there is still a problem
the page-break is not made before the footer,  and the main content is printed on the same area as if the footer did not exist.
What is the solution to prevent printing on the footer ?