I have tried most of solution in the forum to get the footer to stick to the bottom of the page both in view and pdf. Its working perfectly. However now my tables overlap the footer and header as shown below
Since I was unable to get the footer and header to work properly with ERPnext, the only workaround I could do is printing the documents with the letterhead, then using Adobe Acrobat to add background for the letterheads and page numbers