extract positioning code from Page