calculate page dimensions