Added calculation of padding so that the client will have a better understating how long the page is.